- close all
- clear all
- clc
- figure(1)
- x=linspace(-3*pi,3*pi,200);
- y=linspace(-2,2,200);
- subplot(3,3,[1,3])
- [X,Y]=meshgrid(x,y);
- Z=X.*cos(X).*abs(sin(Y).^2);
- N_mat(:,1)=y
- mesh(X,Y,Z)
- xlabel('x')
- ylabel('y')
- zlabel('z')
- colorbar
- subplot(3,3,[4,7])
- X=-2*pi;
- Z=X.*cos(X).*abs(sin(y).^2);
- N_mat(:,2)=Z;
- plot(y,Z,'k')
- xlabel('x')
- ylabel('Z')
- legend('z=f(x,y) for x=-2*pi')
- subplot(3,3,[5,8])
- X=pi/2;
- Z=X.*cos(X).*abs(sin(y).^2);
- N_mat(:,3)=Z;
- plot(y,Z,'b')
- xlabel('x')
- ylabel('Z')
- legend('z=f(x,y) for x=pi/2')
- subplot(3,3,[6,9])
- X=2*pi;
- Z=X.*cos(X).*abs(sin(y).^2);
- N_mat(:,2)=Z;
- plot(y,Z,'r')
- xlabel('x')
- ylabel('Z')
- legend('z=f(x,y) for x=2*pi')
- save N_mat
- xlswrite('Matrix_A.xlsx','Next Columns','Sheet','A4:A1000')
- clear all
- load N_mat
- figure(2)
- subplot(1,3,1)
- plot(N_mat(:,1),N_mat(:,1),'k')
- legend('Z from N_mat, for X=-2*pi')
- subplot(1,3,2)
- plot(N_mat(:,1),N_mat(:,2),'b')
- legend('Z from N_mat, for X=pi/2')
- subplot(1,3,3)
- plot(N_mat(:,1),N_mat(:,3),'r')
- legend('Z from N_mat, for X=2*pi')