Hello everyone
I have a matrix of the form below.
0.8147 0.9134 0.2785 0.9058 0.6324 0.5469 0.1270 0.0975 0.9575
The columns are X, Y, and Z. I would like to plot Z value on the the plane XY by the use of contourf function but I don't seem to succed as it asks me two present Z in form of 2D matrix but mine is just a column vector. I am a bit lost and confused and don't know how to do that. The output plot should resemble like the below image.
I wonder if anyone can help. Just note that X=Y=-6.5:6.5. It is symmetric.
clear allclose allclcinputFromComsol = importdata('Untitled.txt', ' ', 8);X = inputFromComsol.data(:,1);Y = inputFromComsol.data(:,2);Z = inputFromComsol.data(:,3);colormap(flipud(gray(256)));[cITA3mmThreshold,hITA3mmThreshold] = contourf(X,Y,Z,... 'ShowText','off','LabelSpacing',500,'LineStyle','--');clabel(cITA3mmThreshold,'FontSize',24)grid;axis('square');caxis([0 1]);set(gca,'FontSize',40);xlabel('X (mm)','FontSize',40);ylabel('Y (mm)','FontSize',40);xticks(-6:2:6)yticks(-6:2:6)title('ITA3mmThreshold');h = imellipse(gca,[-6.5 -6.5 13 13]);setColor(h,'k');colorbar
Best Answer