Surface plot problem with mesh
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Danila Zharenkov
il 10 Apr 2014
Commentato: Danila Zharenkov
il 12 Apr 2014
Hello, I've got a code that solves pde system. As a result I've got matrix with values in different points (coordinate and time layer). Now I'm trying to plot the surface like this
figure
[x1,y1]=meshgrid(time,x);
surf(x1,y1,u(:,:),'EdgeColor','black');
colormap(copper)
set(gca,'linewidth',2)
shading interp;
grid on;
hold on;
where x and time are vectors of coordinate and time points, u is the result matrix. But the surface looks very strange.

How can I add the lines on this surface? Like this

0 Commenti
Risposta accettata
Mischa Kim
il 10 Apr 2014
Danila, remove
shading interp;
6 Commenti
Mischa Kim
il 11 Apr 2014
Modificato: Mischa Kim
il 11 Apr 2014
Or simply down-sample the matrices. Would this work:
figure;
[x1,y1] = meshgrid(time,x);
xsam = 1:5:size(x1,1); % the 5 sets the lines spacing
ysam = 1:3000:size(x1,2);
surf(x1(xsam,ysam),y1(xsam,ysam),u(xsam,ysam),'EdgeColor','black');
colormap(copper);
You still got all the data (for analysis), for visualization the down-sampled plot should be sufficient.
Più risposte (2)
Kelly Kearney
il 10 Apr 2014
[x,y,z] = peaks(500);
surf(x,y,z);
shading flat;
wireframe(x,y,z,20);
0 Commenti
Vedere anche
Categorie
Scopri di più su Geometry and Mesh in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
