add a number of nodes N between two known nodes

2 vues (au cours des 30 derniers jours)
Alberto Acri
Alberto Acri le 10 Août 2024
Réponse apportée : Voss le 10 Août 2024
How can I add a number of nodes N between two known nodes present in 'NODES'?
NODES = [-41.9153 -20.1597 65.3012;
-33.2487 -10.7068 7.4146];
figure
plot3(NODES(:,1),NODES(:,2),NODES(:,3),'k.','Markersize',30);
axis equal

Réponse acceptée

Voss
Voss le 10 Août 2024
NODES = [-41.9153 -20.1597 65.3012;
-33.2487 -10.7068 7.4146];
N = 5;
t = linspace(0,1,N+2);
t([1 end]) = [];
NODES_new = interp1([0 1],NODES,t);
figure
plot3(NODES(:,1),NODES(:,2),NODES(:,3),'k.','Markersize',30);
hold on
plot3(NODES_new(:,1),NODES_new(:,2),NODES_new(:,3),'r.','Markersize',30);
axis equal

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Produits


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by