Saving workspace variables into one struct
古いコメントを表示
I have a workspace containing
date (178x1 cell)
opposing_team (178x1 double)
team (178x1 double)
win (178x1 double)
I want to merge these variables into 1 struct. I tried using this code here
data = struct('date',{''},'opposing_team',[],'team',[],'win',[]);
but it deletes the data inside it, so when I open the variables it returns with a blank table. How do I create a struct that will keep the data inside? Thanks in advance.
4 件のコメント
Stephen23
2017 年 11 月 28 日
@Adhi Ariawan: do you want a scalar structure containing arrays, or a non-scalar structure containing scalars?
Adhi Ariawan
2017 年 11 月 28 日
編集済み: Adhi Ariawan
2017 年 11 月 28 日
Birdman
2017 年 11 月 28 日
Check my answer.
Stephen23
2017 年 11 月 28 日
@Adhi Ariawan: "scalar" means that the array has size 1x1:
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!