Concatenation of nested cell in one array and writing in text file
1 view (last 30 days)
Show older comments
How do I rearrange a 8x1 nested cell into one long cell array (variable attached). Each (from 8) cell includes 2x1 cell. My goal is twofold:
- saving the of the 8x1 nested cell in a cell array
- writing the unnested cell array to a text file
Thanks!
0 Comments
Accepted Answer
Jan
on 26 Apr 2021
Data = load('nestedCell.mat');
C = cat(2, Data.nestedCell{:});
FID = fopen('YourFile.txt', 'w');
fprintf(FID, '%-8s%g\n', C{:});
fclose(FID)
More Answers (0)
See Also
Categories
Find more on Cell Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!