make one struct with two datasets

3 ビュー (過去 30 日間)
Taha Alars
Taha Alars 2019 年 4 月 17 日
コメント済み: Star Strider 2019 年 4 月 18 日
I have two datasets and I want to make them in one struct just like the exmple in the photo that I uploded. how can I do it??

採用された回答

Star Strider
Star Strider 2019 年 4 月 17 日
Try this:
data.features = rand(84, 1190);
data.labels = rand(84,1);
See the documentation on Create Structure Array (link) for an extended discussion.
Experiment to get the result you want.
  5 件のコメント
Stephen23
Stephen23 2019 年 4 月 18 日
S = load(...)
Star Strider
Star Strider 2019 年 4 月 18 日
@Stephen — Thank you.

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

その他の回答 (1 件)

Taha Alars
Taha Alars 2019 年 4 月 17 日
how can I save the struct that I made to new mat file??
  2 件のコメント
Walter Roberson
Walter Roberson 2019 年 4 月 17 日
save('NameOfNewFile.mat', 'data')
Star Strider
Star Strider 2019 年 4 月 17 日
@Walter — Thank you.

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

カテゴリ

Help Center および File ExchangeVariables についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by