I require a plot of a pcolor for my project result. Each projection data(Trial1, 2,,3,... ) I had set it in numeric matrix form. hh = surface(ze​ros(size(x​)),x,'Pare​nt',cax);

1 回表示 (過去 30 日間)
wyeen chow
wyeen chow 2022 年 5 月 20 日
コメント済み: Walter Roberson 2022 年 5 月 20 日
%LBP formula
DispMap= zeros(pixel);
for Tx=1:N
for Rx=1:N
DispMap= DispMap + (SL(Rx,Tx)*NormEpair{Rx,Tx});
end
end
%%-------Fixed scale 0 to 1------
normDispMap=DispMap; % rename display image
a = min(normDispMap(:));
b = max(normDispMap(:));
for Tx = 1:pixel;
for Rx = 1:pixel;
normDispMap(Tx,Rx) = ((normDispMap(Tx,Rx)-a)./ (b-a))*1;
%%Eliminate NaN value at norm DispMap ; if not matlab cant plot img
e=normDispMap(Tx,Rx);
d=isnan(e);
e(d)=NaN;
normDispMap(Tx,Rx)=e;
end
end
%Displaying map
subplot(1,2,1);
pcolor(normDispMap(1:pixel,1:pixel));
imageCenter=[72.5,72.5];
title('reconstructed image(rescaled 0-1)');
shading interp; % To hide the grid line from pcolor
colormap (jet) % Change color map to jet colour
colorbar % Display colorbar at RHS
subplot(1,2,2);
imagesc(normDispMap(1:pixel,1:pixel))
set(gca, 'YDir', 'normal')
  2 件のコメント
Walter Roberson
Walter Roberson 2022 年 5 月 20 日
d=isnan(e);
e(d)=NaN;
That code is replacing nan with nan.
Walter Roberson
Walter Roberson 2022 年 5 月 20 日
%%-------Fixed scale 0 to 1------
why not just call rescale()?

サインインしてコメントする。

回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by