I am trying to create a contour plot from a matrix of standard deviation values. As you can see in the attached code I have matrixes of U and V. I want to take the standard deviation of each element of these matrixes and compile them into new matrixes of the same size for both U and V. I then plan to plot a contour plot of these standard deviation matrixes similarly to how I plotted U and V with pcolor.
The way I have it set up now does not seem to be outputting a matrix for pcolor to read for standard deviations. Is there anyway to accomplish this?
A=dlmread('B00001.txt', '',1,0); %Read first file
for k=2:100; A=A+dlmread(['B00',sprintf('%03d.txt',k)], '',1,0); %Sum all Matrixes
endA=A/100; %Average Matrixes
X = reshape(A(:,1),124,173); %Reshape all matrixes
Y = reshape(A(:,2),124,173);U = reshape(A(:,3),124,173);V = reshape(A(:,4),124,173);AverageU=mean(nonzeros(U)) %Average Streamwise Velocity
AverageV=mean(nonzeros(V)) %Average Wall Velocity
stdU=std(U);stdV=std(V);pcolor(X,Y,U); %Contour Plot of Streamwise Velocities
hold onshading interpcolormap(jet);h = colorbar;ylabel(h, 'm/s')xlabel('x(mm)')ylabel('y(mm)')pausepcolor(X,Y,V); %Contour plot of Wall Velocities
hold onshading interpcolormap(jet);h = colorbar;ylabel(h, 'm/s')xlabel('x(mm)')ylabel('y(mm)')pausepcolor(X,Y,stdU); %Standard Deviation Contour plot of U
hold onshading interpcolormap(jet);h = colorbar;ylabel(h, 'm/s')xlabel('x(mm)','FontSize',100)ylabel('y(mm)','FontSize',100)pausepcolor(X,Y,stdV); %Standard Deviation contour plot of V
hold onshading interpcolormap(jet);h = colorbar;ylabel(h, 'm/s')xlabel('x(mm)')ylabel('y(mm)')
Best Answer