Need half of my contour plot
Show older comments
Hello I have a contour of the pressures over a surface. Basically, I had vectors x and y which were locations on the surface and on each location, I had a value for pressure. I have a rectangular plot. I was wondering if there is a way to split my plot from the diagonal and show just the results for either upper or lower triangles?
Accepted Answer
More Answers (1)
Pourya Alinezhad
on 18 Jul 2013
Edited: Pourya Alinezhad
on 18 Jul 2013
hello maryam, run following lines of code.
x=0:0.1:10;
y=x;
j=1;
z=meshgrid(x,y);
h=ones(length(x),length(x))*nan;
for i=1:length(x)
for j=1:length(y)
if i>j
h(i,j)=z(i,j);
end
end
end
surf(sin(h)./sqrt(h))
figure
contourf(sin(h)./sqrt(h))
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!