Overlaying a small matrix to a large matrix, contour ploting, enlarging matrix

2 visualizaciones (últimos 30 días)
I have three small matrices (32*32) of X and Y coordinates and corresponding Z values. If I simply make a contour plot, it is taking the spatial extent to the large valyes of X an Y (sayX=985, Y=895). However, I want to plot the Z values in a contour plot to the spatial extent of 1024*1024. How can I plot this? Also, can I replace the values of Z matrix (32*32) with corresponding to the X and Y values in the matrix (32*32) in matrix to a new matrix of 1024*1024 with zeros. Or can I enlarge the matrix Z (32*32) to new matrix of 1024*1024 filling with zeros? I have to maintain the coordinates or locations of Z values in the large new matrix. I hope I can make my question clear. Please help. Thanks a lot in advance.

Respuesta aceptada

bym
bym el 15 de Ag. de 2011
maybe I don't understand, but is this what you are after
x = linspace(0,985,32);
[X,Y] = meshgrid(x,x);
Z = X.*Y+Y;
contour(X,Y,Z)
xlim([0,1024]),ylim([0,1024])
  1 comentario
Asim
Asim el 15 de Ag. de 2011
Thanks very much for the answer.
Let me try to clear my problem.
I have 3 matrices, X, Y, Z. X and Y are coordinates and Z are the values. X and Y have not continuous value rather a sampling from 1:1024. So only 32*32 numbers and not 1024*1024 number. For example, the first point in X and Y matrix is point 3 and the last point is 985 and 980 respectively. In this situation, if I only plot (contour)
contour(X, Y, Z); the contour plot takes the max X axis to 985 and Y to 980. However, if I set the Xlim and Ylim to 1024, the rest area from 985 and 980 to 1024 shows blank. Howevder, I want the contours to extend to 1024 in both axis. Is it possible to do this way.
Alternatively, I was thinking of creating a zero matrix of 1024*1024. So here the X and Y coordinate will extend to 1024 and all the Z values are Zero. Now is it possible to overlay my original Z axis (32*32) in this new zero matrix? As the original Z matrix have X and Y coordinates, can I match those coordinates with the new coordinates of zero matrix.
What exactly, I am trying to do- I have decomposed a 2D image or 1024*1024 pixels using curvelt transform. I got the curvelet coefficinets at some selective points (32*32) in the image. What I want to do, I want to keep those coefficients and make the rest points are zero to reconstruct the image again. I am a very basic user of Matlab and used script from other people to run this analysis. I want to plot the curvelet coefficients in plot with the same spatial extent of the original image.
I hope i can make it clear.
thanks again.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Contour Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by