close all;home;clc;clear all;
for k=1:1:10;
x(k,1)=k;
y(k,1)=x(k,1).^2;
end
plot(x,y)
close all;home;clc;clear all;
for k=1:1:10;
x(k,1)=k;
y1(k,1)=x(k,1).^2;
end
for k=1:1:10;
x(k,1)=k;
y2(k,1)=2*x(k,1).^2;
end
plot(x,y1,x,y2)
close all;home;clc;clear all;
for k=1:1:10;
x(k,1)=k;
y(k,1)=x(k,1).^2;
y(k,2)=2*x(k,1).^2;
end
plot(x,y)
close all;home;clc;clear all;
for k=1:1:10;
x(k,1)=k;
if k<=5;
y(k,1)=x(k,1).^2;
else
y(k,1)=2*x(k,1).^2;
end
end
plot(x,y)
Commenti