How to write data from a Cell Array as multiple columns in a text or CSV file?
Greeting,
I have a 1×2 cell array with data in each cell. I’m trying to extract the data from each cell and write it to a CSV or text file. I’ve tried various combinations of writecell, cell2table, writetable, etc. The closest I can get us using writecell, but I end up with a single row containing all the data from both cells in the cell array.
Does anybody have a suggestion how to end up with multiple columns when I write my output to a file?
For context, right now my cell array is 1×2, and is only this small since I’m building and troubleshooting a Simulink model and data output script. Once I finish troubleshooting, the real deal data in the cell array will probably be around 1×20, and I’ll be doing about 10 runs in Simulink (so 10 total sets of 1×20 output in my cell arrays).
Thanks in advance!Greeting,
I have a 1×2 cell array with data in each cell. I’m trying to extract the data from each cell and write it to a CSV or text file. I’ve tried various combinations of writecell, cell2table, writetable, etc. The closest I can get us using writecell, but I end up with a single row containing all the data from both cells in the cell array.
Does anybody have a suggestion how to end up with multiple columns when I write my output to a file?
For context, right now my cell array is 1×2, and is only this small since I’m building and troubleshooting a Simulink model and data output script. Once I finish troubleshooting, the real deal data in the cell array will probably be around 1×20, and I’ll be doing about 10 runs in Simulink (so 10 total sets of 1×20 output in my cell arrays).
Thanks in advance! Greeting,
I have a 1×2 cell array with data in each cell. I’m trying to extract the data from each cell and write it to a CSV or text file. I’ve tried various combinations of writecell, cell2table, writetable, etc. The closest I can get us using writecell, but I end up with a single row containing all the data from both cells in the cell array.
Does anybody have a suggestion how to end up with multiple columns when I write my output to a file?
For context, right now my cell array is 1×2, and is only this small since I’m building and troubleshooting a Simulink model and data output script. Once I finish troubleshooting, the real deal data in the cell array will probably be around 1×20, and I’ll be doing about 10 runs in Simulink (so 10 total sets of 1×20 output in my cell arrays).
Thanks in advance! cell arrays, cell2table, writetable, writecell MATLAB Answers — New Questions