본문 바로가기

Matlab

Plot


>> x = linspace(0,10,100); %0~100까지 100개의 element를 갖는 row vector 생성

>> y1 =sin(x);

>> y2=cos(x);

>> plot(x,y1,'r',x,y2,'b:') %

>> title('Sine and Cosine graph');

>> xlabel('x');

>>ylabel('y');

>>grid on

>>legend('sin(x)','cos(x)') %범례



 >> clear

>> x = linspace(0,10,100); 

>> subplot(2,2,1);

>> plot(x,sin(x));

>> subplot(2,2,[2 4]);

>> plot(x,cos(x));

>> subplot(2,2,3);

>> plot(x,tan(x));

 


 >> load korea %load - mat파일 로드, importdata - text,csv파일 로드



'Matlab' 카테고리의 다른 글

Pseudo-random number generation  (0) 2014.05.12
Datatype  (0) 2013.12.23
Control Flow  (0) 2013.12.23
M-file  (0) 2013.12.23
Matrix Operator  (0) 2013.12.23