Originally Posted by
ben100 Generate an image I with x and y both varying from -10 to 10 with step-size dx and dy both as 0.2, and scale the intensity value of the image to [0, 255];
theta = pi/6
dx = 0.2
dy = 0.2
x=-10
y=-10
a=0.4
mat = zeros(100) %create 100 by 100 matrix. y? -10 to 10 is 20.. and increment by 0.2 so -10, -9.8, -9.6 ... 9.6, 9.8, 10 has 100 in total.
for i=0:100
for j=0:100
mat(i,j)=partBhelper (x,y, theta,a)
increment x by dx;(how?)
end
reset x to -10 (how?)
increment y by dy(how?)
end
display the matrix but scale it to 0 to 255 (hint. imshow())
end
see my underlined answer,because i'm not sure and do not know how to make it in the source code.
thank you,
Something like:
Code:
-->
--> x=linspace(-10,10,101);
--> y=linspace(-10,10,101);
-->
--> [X,Y]=meshgrid(x,y);
-->
--> Z=rand(size(X))*255;
-->
--> image(X,Y,Z);
-->
CB