Azzera filtri
Azzera filtri

rotate figure by transposing matrix in contourf problem

7 visualizzazioni (ultimi 30 giorni)
Hi: I want to rotate the contour plot by transposing the matrix. but the potted figures are observed to be the same. I'm not sure there is any problem with my code. Could anyone give me some suggestions?
code is below:
load new_X
load new_Y
load new_Z
figure(1)
[xc,yc]=contourf(new_X,new_Y,new_Z);
axis equal
figure(2)
[xc,yc]=contourf(new_X',new_Y',new_Z');
axis equal
Thanks! Yu

Risposta accettata

jonas
jonas il 21 Ago 2018
Modificato: jonas il 21 Ago 2018
Transposing every matrix does not change anything. If you throw two matrices X & Y as input, then the coordinates for each Z-value is obtained from those matrices, i.e. Z(1,1) is plotted at [X(1,1) Y(1,1)]. If you transpose each matrix, then the coordinates for each Z remains the same. If you are instead throw only the Z matrix as input to contourf, then transposing it works because the Z-values are plotted against their index, i.e. Z(1,1) is plotted at [1 1].
I suppose this is what you are trying to do:
[xc,yc]=contourf(new_Y,new_X,new_Z);

Più risposte (0)

Categorie

Scopri di più su Contour Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by