14_Nowak_Bartosz_ćw2.pdf

(444 KB) Pobierz
BARTOSZ NOWAK, GR. 14, ID, WIMiR
SPRAWOZDANIE Z ĆWICZEŃ NR. 2
DATA: 11.03.2009r
ZADANIE 1.
t=0:pi/50:2*pi;
m=(sin(t));
n=(cos(2*t));
plot(t,m, 'r--' ,t,n, 'g+' );
xlabel( 'wartosc x' );
ylabel( 'wartosc y' );
title( 'Wykres1' );
legend( 'sin(t)' , 'cos(2*t)' );
text(0,0, 'funcja1' );
text(2.5,0, 'funcja2' );
grid on ;
______________________________________________________________________________________________
ZADANIE 2
t=0:0.2:2*pi;
bar(t,sin(t));
title( 'wykres slupkowy sin(t)' );
xlabel( 'x' );
ylabel( 'y' );
grid on ;
______________________________________________________________________________________________
ZADANIE 3
[x,y]=meshgrid(-5:0.1:5,-10:0.5:10);
z=sin(x).*cos(y);
mesh(x,y,z);
xlabel( 'os x' );
ylabel( 'os y' );
zlabel( 'os z' );
title( 'wykres' );
_____________________________________________________________________________________________
ZADANIE 4
[x,y]=meshgrid(-1:0.01:1,-1:0.02:1);
z=tan(x)+tan(y);
mesh(x,y,z);
xlabel( 'x' );
ylabel( 'y' );
zlabel( 'z' );
title( 'wykres tan(x)+tan(y)' );
view(45,45)
figure
mesh(x,y,z)
xlabel( 'x' );
ylabel( 'y' );
zlabel( 'z' );
title( 'wykres tan(x)+tan(y)' );
996993271.013.png 996993271.014.png 996993271.015.png 996993271.016.png 996993271.001.png
view(0,0)
figure
mesh(x,y,z)
xlabel( 'x' );
ylabel( 'y' );
zlabel( 'z' );
title( 'wykres tan(x)+tan(y)' );
view(45,0)
____________________________________________________________________________________________
ZADANIE 5
A=zeros(5);
A(1:6:25)=50;
B=2*A;
C=4*A;
D=0.5*A;
subplot(2,2,1);
image(A);
title( 'macierz A (z 50 na przekątnej)' );
xlabel( 'kolumna' );
ylabel( 'wiersz' );
subplot(2,2,2);
image(B);
title( 'macierz B (z 100 na przekatnej)' );
xlabel( 'kolumna' );
ylabel( 'wiersz' );
subplot(2,2,3);
image(C);
title( 'macierz C (z 200 na przekatnej)' );
xlabel( 'kolumna' );
ylabel( 'wiersz' );
subplot(2,2,4);
image(D);
title( 'macierz D (z 10 na przekatnej)' );
xlabel( 'kolumna' );
ylabel( 'wiersz' );
______________________________________________________________________________________________
ZADANIE 6
A=zeros(5);
A(1:6:25)=50;
B=2*A;
C=4*A;
D=0.5*A;
E=0.1*A;
FILM=moviein(5);
image(A);
FILM(1)=getframe;
image(B);
FILM(2)=getframe;
image(C);
FILM(3)=getframe;
image(D);
FILM(4)=getframe;
image(E);
FILM(5)=getframe;
movie(FILM,5);
(ostatnia klatka filmu odtworzonego 5 razy)
_______________________________________________________________________________________________
996993271.002.png 996993271.003.png 996993271.004.png
ZADANIE 7
rys=imread( 'a.jpg' );
R=rys(:,:,1);
G=rys(:,:,2);
B=rys(:,:,3);
subplot(2,2,1)
image(rys);
title( 'orginal' );
subplot(2,2,2)
image(R);
title( 'czerwony' );
subplot(2,2,3)
image(G);
title( 'zielony' );
subplot(2,2,4)
image(B);
title( 'niebieski' );
___________________________________________________________________________________________________
ZADANIE 8
rys=imread( 'a.jpg' );
rys1=double(rys/255);
image(rys1)
rys2=rys*0.1;
figure
image(rys2)
rys3=rys+1;
figure
image(rys3)
rys4=rys.*rys;
figure
image(rys4)
rys5=rys(:,:,3);
figure
image(rys5)
996993271.005.png 996993271.006.png 996993271.007.png 996993271.008.png 996993271.009.png 996993271.010.png 996993271.011.png 996993271.012.png
Zgłoś jeśli naruszono regulamin