# 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);

2 views (last 30 days)
wyeen chow on 20 May 2022
Commented: Walter Roberson on 20 May 2022
%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 CommentsShow NoneHide None
Walter Roberson on 20 May 2022
d=isnan(e);
e(d)=NaN;
That code is replacing nan with nan.
Walter Roberson on 20 May 2022
%%-------Fixed scale 0 to 1------
why not just call rescale()?