Could there be a way for example of getting all the data that appears on each of the plots (even though the previous plots are not showing)and for example add up every single value (for every point on the graph) so that I can get an overall value? This would allow me to see the minimums as these will be the points that have obtained a minimum value in all the graphs that have been drawn as when added it will be the point with the less value. All the other points would have bigger values as in one graph or another of the 20 drawn it shows it's not a minimum value area...I hope you understand
Adding the results of several pcolor graphs...
1 次查看(过去 30 天)
显示 更早的评论
Hello everyone: I am having difficulties, as I have made a program which calculates some values which it later represents in a pcolor graph (I will paste the code below). The values are calculated one by one in terms of two variables (n_re and n_im) and the color map just indicates the mean difference between my theoretical Contrast (Cteo) and my experimental Contrast (Cexp). The problem is that even though it obtains the correct answers each time (I've tried calculating just one value at a time) if done individually, it only displays in the pcolor graph the last value calculated if a series of values are used (loaded from a table experimental_values_M2612)I need some function or an idea of how I could manage to get each individual result obtained by the program and display it as one overall pcolor graph where I can see a real minimum for ALL my results instead of just one at a time.
function [] = mapa
m=30;
n_re=linspace(1,6,m);
n_im=linspace(0,5,m);
% z=zeros(m,m);
global lambda0;
lambda0=500;
% global z;
% z=[m,m];
load('C:\Users\Weinberg\Desktop\Prueba matlab\Prueba pcolor_V1\Samples\experimental_values_M2612')
tic
for v=1:20
d=Experimental_values(v,1);
Cexp=Experimental_values(v,3);
for i=1:m
for j=1:m
n=n_re(i)+1i*n_im(j);
z(i,j)=cx2(lambda0,d,n,Cexp);
end
end
pcolor(n_re,n_im,z);shading interp; colormap(jet);
toc
end
end
function [x2]=cx2(lambda0,d,n,Cexp)
x2=(Cexp-Cteo(lambda0,d,n)).^2;
end
function [C]=Cteo(lambda0,d,n)
nair=1;
dSiO2=285;
nSi=2
nSiO2=2
%calcular el contraste teorico
mSiO2=Sij(nair,nSiO2)*Pj(nSiO2,dSiO2,lambda0)*Sij(nSiO2,nSi);
mflake= Sij(nair,n)*Pj(n,d,lambda0)...
*Sij(n,nSiO2)*Pj(nSiO2,dSiO2,lambda0)*Sij(nSiO2,nSi);
rSiO2=abs(mSiO2(2,1)/mSiO2(1,1))^2;
rflake=abs(mflake(2,1)/mflake(1,1))^2;
C =(rflake-rSiO2)/(rflake+rSiO2);
end
Any help will be greatly appreciated, and thank to anyone that can help me in advance. Guillermo
回答(2 个)
Image Analyst
2012-4-19
I assume you know that pcolor does not color the "tiles" according to what their value is, like image, imagesc, or imshow does. If you didn't know that, then switch to one of those functions.
5 个评论
Image Analyst
2012-4-19
You already have the matrix as a variable. You needed that before you displayed it. If you want to save a picture of the figure window, use export_fig (in the Mathworks File Exchange).
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!