surface and plot3 linking edges that should not be linked on the plot
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Voss
le 1 Fév 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])
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
