Discrepancy in imagesc from given matrix

7 views (last 30 days)
I want to plot a heatmap of a matrix with corresponding values of d1 and d2 using imagesc
%Relevant code
d1=linspace(0.1,2.2,200);
d2=linspace(0.1,2.2,200);
x=d1;
y=d2;
z=readmatrix('Plant.csv');
imagesc(x,y,z)
colorbar
colormap(flipud(hot))
set(gca,'YDir','normal')
d1(150)=1.67
d2(50)=0.6
z(150,50)=0.43
However according to the plot z(150,50)=0; this is very confusing to me am I using imagesc wrong

Accepted Answer

Walter Roberson
Walter Roberson on 13 Aug 2022
Remember that z(150,50) is z at the 150th Y value and the 50th X value. Rows correspond to Y not to X.
  4 Comments

Sign in to comment.

More Answers (0)

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by