Professional Documents
Culture Documents
Workspace
Current Folder
Commend Window
Editor
Documentation
>> b=1;
>> c=[1:5;6:10]
>> size(c)
>> 1==1
>> 3==4
>> 1~=3
complex numbers
>> sqrt(-1)
character class
To install a new or updated package version manually, the package file can be downloaded from the Octave
Forge website to the working directory and can be installed using:
Symbolic Package
1
27.02.2020 E.D.
>> A=(x-y)*(x+y)^2+x^2
>> B=subs(A, x, y*x^2) % changes x in the A equation with y*x^2
>> simplify(A)
>> sym (1/3+1/24)
>> clc
>> clear all
>> close all
Plot Example
>> X=[0:0.1:10]; % a row vector starting from 0 to 10 with 0.1 step size
>> Y=randi([-10 10],size(X,2),1);% random integers -10 to 10 same size X
>> Z=Y.^2;
>> plot(X,Y,'ro')
>> plot(X,Y,'ro',X,Z,'k*')
>> plot3(X,Y,Z)
>> csvwrite('example.csv',E)
>> B=csvread('example.csv')
2
27.02.2020 E.D.
>> a=5;
>> f = @(x)x^2 % anonymous function name of f which calculates f(x)=x^2
>> f2=@(x,y)x.^2+y.^2 % function with two input, f(x,y)=(x^2+y^2)
>> f2(3,5)
Application 1
Application 2
Generate a 25x25 matrix I including random integers range from 0 to 100 (use
randi() function). calculate how many elements of the matrix are greater
than 80 (use for loop).