MATLAB Multiplying Two Functions
clc
clear
M=50;
N=50;
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;
x1(i)=(sin(i));
y1(i)=(sin(i));
f(i)=x1(i)*y1(i)
end
plot(x,f,'r--')
xlabel('x axis','FontSize',10)
ylabel('y axis','Rotation',0,'FontSize',10)
title('Graph')
grid on
clear
M=50;
N=50;
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;
x1(i)=(sin(i));
y1(i)=(sin(i));
f(i)=x1(i)*y1(i)
end
plot(x,f,'r--')
xlabel('x axis','FontSize',10)
ylabel('y axis','Rotation',0,'FontSize',10)
title('Graph')
grid on
Unless otherwise noted, all content on this site is @Copyright by Ahmed Al Makky 2012-2013 - http://cfd2012.com