Matlab
Plot
장곰부대
2013. 12. 23. 23:26
>> 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파일 로드