MATLAB Adding Two Functions
clc
clear
M=10;
N=10;
x0=-2;
xx=2;
LX=xx-x0;
y0=-50;
yy=50;
LY=yy-y0;
dx=LX/M;
dy=LY/N;
x=(x0:dx:xx);
y=(y0:dy:yy)
for i=1:M+1;
y1(i)=(x(i))^2
y2(i)=(y(i))^2
Y(i)=y1(i)+y2(i)
end
plot(x,Y)
grid on
clear
M=10;
N=10;
x0=-2;
xx=2;
LX=xx-x0;
y0=-50;
yy=50;
LY=yy-y0;
dx=LX/M;
dy=LY/N;
x=(x0:dx:xx);
y=(y0:dy:yy)
for i=1:M+1;
y1(i)=(x(i))^2
y2(i)=(y(i))^2
Y(i)=y1(i)+y2(i)
end
plot(x,Y)
grid on
Unless otherwise noted, all content on this site is @Copyright by Ahmed Al Makky 2012-2013 - http://cfd2012.com