How to save a matrix from an object with unknow name?
1 回表示 (過去 30 日間)
古いコメントを表示
I have a file with around 50 variables, each with different names, so I have their names contained in a cell array called filtered_vars.
Then in order to load them I was using
for i=1:1%size(filtered_vars,1)
temp=load('merged_t7_original',filtered_vars{i})
end
temp =
struct with fields:
N_force_wind_to_wave_Nmin: [1444202×672×2 single]
Now my problem is that the variable temp corresponds to a structure object with the name of the variable which was loaded, and then I don't know how to read it in order to save it into a matrix.
2 件のコメント
Adam Danz
2020 年 10 月 31 日
I assume this isn't the actual code you're using since 'temp' would be overwritten on each iteration.
What are the values being loaded?
Are they are numeric scalars? Are they vectors?
Do they contain mixed data types where some are strings|cell arrays|object handles, etc?
Are you trying to store all of the values into a different type of an array?
Do you want to keep all of the variables or are you just searching for some of them?
Lots of unknowns.....
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Text Analytics Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!