Beruflich Dokumente
Kultur Dokumente
TECH (MECHANICAL)
disp(Hello!!)
or
disp(x1)
comment line
or
/*lines*/
a=32
b=a*34 c=b+2*a
default value
pi=3.14156
a=sqrt(b)
a=power(b,n) a=sin(x) a=asin(b) a=abs(b)
A=zeros(m,n)
A=zeros(m) A=ones(m,n) A=[1
2 3; 4 5 6; 4 5 6] A=1:0.2:10 A=meshgrid(0:0.1:10,0:0.2:100)
//add two arrays //add to all elements //multiply to all elements //determinant //inverse
10
11
X=0:0.1:100;
Y=f(x); plot(x,y);
axis([x1 x2 y1 y2]);
12
[x,y]=meshgrid(0:0.1:10,0:0.2:100)
Z=f(x,y) surf(x,y,Z) or mesh(x,y,Z)
axis([x1 x2 y1 y2 z1 z2])
13
Declaring function [o1 o2] = func_name (i1) code end //save as func_name.m file
Calling in your program [a1 a2]=func_name([1 2 3 4])
14
15