Structure array to array
2 ビュー (過去 30 日間)
古いコメントを表示
I have a structure
s(1).x = 5;
s(2).x = 6;
s(1).y = 1;
s(2).y = 8;
how can i convert this into an array of x values and an array of y values, preferably without using a for loop?
Im trying to plot(s(:).x, s(:).y) but it only plots one point hence why i ask.
0 件のコメント
回答 (2 件)
Azzi Abdelmalek
2013 年 9 月 26 日
編集済み: Azzi Abdelmalek
2013 年 9 月 26 日
s(1).x = 5;
s(2).x = 6;
s(1).y = 1;
s(2).y = 8;
plot([s.x],[s.y])
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!