Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- >> subplot(3,2,3) %tri puta dva grafika, crta se u trecem grafiku
- >> x=0:0.1:10*pi;
- >> y=cos(x);
- >> z=sin(x);
- >> plot3(x,y,z) %plot3 = naredba za linijske grafike
- >> title('3D-Grafika')
- >> xlabel('x-osa')
- >> ylabel('y-osa')
- >> zlabel('z-osa')
- >> comet3(x,y,z) % iscrtava putanju grafika
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- >> y=cos(t).*sin(t); %mnozenje svakog clana pojedinacno
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- >> x=-3:3
- x =
- -3 -2 -1 0 1 2 3
- >> y=-2:2
- y =
- -2 -1 0 1 2
- >> [X,Y]=meshgrid(x,y)
- X =
- -3 -2 -1 0 1 2 3
- -3 -2 -1 0 1 2 3
- -3 -2 -1 0 1 2 3
- -3 -2 -1 0 1 2 3
- -3 -2 -1 0 1 2 3
- Y =
- -2 -2 -2 -2 -2 -2 -2
- -1 -1 -1 -1 -1 -1 -1
- 0 0 0 0 0 0 0
- 1 1 1 1 1 1 1
- 2 2 2 2 2 2 2
- >> Z=X.^2-Y.^2
- Z =
- 5 0 -3 -4 -3 0 5
- 8 3 0 -1 0 3 8
- 9 4 1 0 1 4 9
- 8 3 0 -1 0 3 8
- 5 0 -3 -4 -3 0 5
- >> mesh(Z)
- >> surf(Z)
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- >> y=-3:0.2:3;
- >> y=-2:0.2:2;
- >> [X,Y]=meshgrid(x,y);
- >> Z=2-(X.^2+Y.^2);
- >> mesh(Z)
- >> meshc(Z)
- >> meshz(Z)
- >> colormap(cool)
- >> waterfall(Z)
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- >> x=0:0.1:10*pi;
- >> y=0:0.1:10*pi;
- >> [X,Y]=meshgrid(x,y);
- >> Z=3*sin(X)+cos(Y);
- >> subplot(2,3,1),mesh(Z),title('mesh')
- >> subplot(2,3,2),meshc(Z),title('meshc')
- >> subplot(2,3,3),meshz(Z),title('meshz')
- >> subplot(2,3,4),surf(Z),title('surf')
- >> subplot(2,3,5),surfc(Z),title('surfc')
- >> subplot(2,3,5),waterfall(Z),title('waterfall')
- >> subplot(2,3,5),surfc(Z),title('surfc')
- >> subplot(2,3,6),waterfall(Z),title('waterfall')
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- >> surf(peaks(20))
- >> surf(peaks(50)) %veca rezolucija
- >> surf(peaks(500)) %nista se ne vidi
- >> surf(peaks(50))
- >> contour(peaks(20)) %vide se samo konture iz pticije perspektive
- >> contour(peaks(20),5)
- >> contour(peaks(20),15) %veci broj kontura
- >> contour3(peaks(20),15) %3D konture
- >> contour3(peaks(20),50)
- >> sphere(10) %lopta
- >> sphere(100)
- >> cylinder(2)
- >> cylinder(20) %menja se poluprecnik a ne rezolucija
- >> cylinder(20,5)
- >> cylinder(20,50) %menja se rezolucija sa drugim brojem
- >> cylinder([20,30],50) %gornji i donji poluprecnik
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Add Comment
Please, Sign In to add comment