clc;
close all;
clear;
workspace;
format longg;
format compact;
fontSize = 20;
dx=0:0.01:1.99;
dy=0:0.01:1.99;
numberOfColumns = length(dx);
numberOfRows = length(dy);
sxy = zeros(numberOfRows, numberOfColumns);
u0=2;
v0=0;
A=50;
B=0;
for row = 1 : numberOfRows
dyThisRow = dy(row);
s = sin(2*pi*(u0.*dx+v0*dyThisRow));
thisRow = (A+B*(sin(2*pi*(u0.*dx+v0*dyThisRow))));
sxy(row,:) = thisRow;
end
subplot(2,2,1);
imshow(sxy, [0 75]);
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
xlabel('0\leqx\leq1.99', 'FontSize', fontSize);
title('Plot of sin(4\pix)+50', 'FontSize', fontSize);
u0=2;
v0=0;
A=50;
B=10;
for row = 1 : numberOfRows
dyThisRow = dy(row);
thisRow = (A+B*(sin(2*pi*(u0.*dx+v0*dyThisRow))));
sxy(row,:) = thisRow;
end
subplot(2,2,2);
imshow(sxy, [0 75]);
xlabel('0\leqx\leq1.99', 'FontSize', fontSize);
title('Plot of 10sin(4\pix)+50', 'FontSize', fontSize);
u0=2;
v0=0;
A=50;
B=25;
for row = 1 : numberOfRows
dyThisRow = dy(row);
thisRow = (A+B*(sin(2*pi*(u0.*dx+v0*dyThisRow))));
sxy(row,:) = thisRow;
end
subplot(2,2,3);
imshow(sxy, [0 75]);
xlabel('0\leqx\leq1.99', 'FontSize', fontSize);
title('Plot of 25sin(4\pix)+50', 'FontSize', fontSize);
u0=2;
v0=0;
A=50;
B=50;
for row = 1 : numberOfRows
dyThisRow = dy(row);
thisRow = (A+B*(sin(2*pi*(u0.*dx+v0*dyThisRow))));
sxy(row,:) = thisRow;
end
subplot(2,2,4);
imshow(sxy, []);
xlabel('0\leqx\leq1.99', 'FontSize', fontSize);
ylabel('s(x,y)', 'FontSize', fontSize);
title('Plot of 50sin(4\pix)+50', 'FontSize', fontSize);
Best Answer