How can make a vector from a structure?

3 ビュー (過去 30 日間)
Austin Scheinkman
Austin Scheinkman 2019 年 7 月 19 日
コメント済み: Austin Scheinkman 2019 年 7 月 19 日
I have this structure from a data set I was sent and have to make a simple scatter plot with di and from the field 100 and yi from field 100. How do I turn each of those things into vectors so I can in turn plot them up. Im brand new to matlab so this is quite confusing to me any help would be great.

採用された回答

Image Analyst
Image Analyst 2019 年 7 月 19 日
T(100).xi already IS a vector. You can simply use it as x:
plot(T(100).xi, T(100).yi, 'b-');
grid on;
Or you can take all of the 1000 from elements from all of the 1011 structures in your "T" structure array with brackets:
all_xi = [T.xi];
all_yi = [T.yi];
scatter(all_xi, all_yi);
grid on;
  1 件のコメント
Austin Scheinkman
Austin Scheinkman 2019 年 7 月 19 日
Dude thanks so much. Your fuckin awesome.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by