Need help creating an 2-D 400×300 array

Need help creating a meshgrid() to create a 2-D 400×300 array of numbers. I want to design an interesting function like the product of two sine functions using the array values as inputs. I want to a create a grayscale image of this function with imagesc(). and also add a colorbar and label both axes. I also need to change the values of the array elements [100:110, 50:60] to make something that will be visible in the image. Much appreciated for the help.

댓글 수: 2

madhan ravi
madhan ravi 2019년 4월 20일
What have we tried so far?
JC
JC 2019년 4월 20일
My first method was to create these arrays. One 400x300 array.
A = repmat(1:400,300,1)
B = repmat(100:110,50,60)
Another method for the meshgrid part that I followed
colormap('gray')
nx=300;
x=-nx/2:nx/2-1;
ny=400;
y=-ny/2:ny/2-1;
[X,Y]=meshgrid(x,y);

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

태그

질문:

JC
2019년 4월 20일

댓글:

JC
2019년 4월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by