node creation using for loop
이전 댓글 표시
how can we create nodeset having data like node_number, x,y,z coordinates say for 20 nodes using for loop
댓글 수: 6
KSSV
2020년 9월 10일
Attach your data.
Shahrukh s
2020년 9월 10일
KSSV
2020년 9월 10일
You cannot have 20 nodes for given x and y. You will have more number of nodes. Check the links given in the answer.
Steven Lord
2020년 9월 10일
What do you want to do with this data once you've chosen the "best" data structure to store your nodeset? Plot it? Connect nodes into a network graph? Something else?
Shahrukh s
2020년 9월 10일
KSSV
2020년 9월 10일
x = 100:120 ;
y =10:20 ;
[X,Y] = meshgrid(x,y) ;
mesh(X,Y)
답변 (2개)
KSSV
2020년 9월 10일
0 개 추천
This should help you:
Also have a look on:
Ameer Hamza
2020년 9월 10일
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)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!