Educoder中MATLAB基础进阶

第1关:二维图形的绘制

%%%%%%%%%%%%%%%%%%
warning('off','all');
graphics_toolkit('gnuplot')
%%%%%%%%%%%%%%%%%%
m1=0:0.1:5;
m2=0:0.2:10;
m3=0:0.15:7.5;
y1=cos(m1);
y2=sin(m2);
y3=cos(m1).+sin(m3);
figure (1)
subplot(1,2,1)
%%%%%%%%% Begin %%%%%%%%%
x=[m1;m2;m3]';
y=[y1;y2;y3]';
plot(x,y);
title('figure 1')
%%%%%%%%% End %%%%%%%%%
subplot(1,2,2)
%%%%%%%%% Begin %%%%%%%%%
plotyy(m1,y1,m2,y2);
title('figure 2')
%%%%%%%%% End %%%%%%%%%
sa=pwd;
print(1,'-djpeg','./picture/step1/picture1.jpg');
run('./task1/test1.m');
system('python3  ./task1/test1py.py');

第2关:三维图形和

%%%%%%%%%%%%%%%%%%
%请不要修改
warning('off','all');
graphics_toolkit('gnuplot')

%%%%%%%%%%%%%%%%%%

figure (1)
subplot(1,2,1);

%%%%%%%%% Begin %%%%%%%%%

m1=-16:0.5:16;
m2=-10:0.5:10;
[x,y]=meshgri

你可能感兴趣的:(matlab)