node creation using for loop

6 Ansichten (letzte 30 Tage)
Shahrukh s
Shahrukh s am 10 Sep. 2020
Kommentiert: KSSV am 10 Sep. 2020
how can we create nodeset having data like node_number, x,y,z coordinates say for 20 nodes using for loop
  6 Kommentare
Shahrukh s
Shahrukh s am 10 Sep. 2020
i just want a for loop programme to execute this type data structure
KSSV
KSSV am 10 Sep. 2020
x = 100:120 ;
y =10:20 ;
[X,Y] = meshgrid(x,y) ;
mesh(X,Y)

Melden Sie sich an, um zu kommentieren.

Antworten (2)

KSSV
KSSV am 10 Sep. 2020

Ameer Hamza
Ameer Hamza am 10 Sep. 2020
Try using graph() object provided by MATLAB: https://www.mathworks.com/help/releases/R2020a/matlab/ref/graph.html. For example,
node_ID = string(1:20);
x = rand(20,1);
y = rand(20,1);
z = rand(20,1);
G = graph(zeros(20), node_ID);
G.Nodes.x = x;
G.Nodes.y = y;
G.Nodes.z = z;
plot(G)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by