Writing a struct into a text file (.sto file)
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, I have a 1*1 struct like this:
str =
data: [11x31 double]
textdata: {15x31 cell}
colheaders: {1x31 cell}
I want to write this struct into a .sto file. An example of this .sto file generated by OpenSim software is like this:

When I import the above .sto file in MATLAB, I got a 1*1 struct like what I produced. Now I want to write my struct into a .sto file. I appreciate it if you could help me we this.
回答 (1 件)
Prajit T R
2018 年 2 月 22 日
Hi
I understand that you wish to convert a struct into a text file. Convert the struct to a table and then use the function write2table as follows:
writetable(struct2table(str), 'str.txt')
You can convert the structure to .txt,.csv and .dat using this method. I'm not certain about .sto files.
Cheers
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Scope Variables and Generate Names についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!