surface and plot3 linking edges that should not be linked on the plot
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
The following code produces a plot which has a linked edge running across the plot, running on R2023b:

- see attached file for the data where 'T' becomes x,'x' becomes y and 'V(x,t)' becomes z
The code:
x = double(table2array(SystemLearning(:,1)));
y = double(table2array(SystemLearning(:,2)));
z= double(table2array(SystemLearning(:,3)));
[X,Y] = meshgrid(x,y);
% Z = griddata(x,y,z,X,Y,'natural');
% Z = griddata(x,y,z,X,Y,'cubic');
Z = griddata(x,y,z,X,Y,'cubic');
mesh(X,Y,Z)
axis tight; hold on
plot3(x,y,z,'.','MarkerSize',15)
%surf(X,Y,Z, 'EdgeColor','none')
xlabel('Time(t)')
ylabel('space(x)')
zlabel('V(x,t)')
0 Commenti
Risposta accettata
Voss
il 1 Feb 2024
SystemLearning = readtable('SystemLearning.csv','VariableNamingRule','preserve');
x = SystemLearning{:,1};
y = SystemLearning{:,2};
z = SystemLearning{:,3};
NX = numel(unique(x));
X = reshape(x,[],NX);
Y = reshape(y,[],NX);
% Z = griddata(x,y,z,X,Y,'natural');
Z = griddata(x,y,z,X,Y,'cubic');
mesh(X,Y,Z)
axis tight; hold on; grid on
plot3(x,y,z,'.','MarkerSize',15)
% surf(X,Y,Z, 'EdgeColor','none')
xlabel('Time(t)')
ylabel('space(x)')
zlabel('V(x,t)')
view([70 20])
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Surface and Mesh Plots 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!
