put together cells from different cell arrays and writing it to a file
Show older comments
Hey I have got multiple patch objectes that have data in the UserData property. I attached two mat-files to show how these UserData cell arrays will look like.
Starting from cell(1,3) I want to put togehter the cells that posess the same position in one new variable. After that I want to write the joint data into a file with fopen() and fprintf() in the right order.
What data type do you recommend to use knowing I want to write it into a file afterwards?
And have you an idea how to handle the empty cells and the different sizes of the cell arrays? E.g. UserData_1 has data in cell(1,5) and UserData_2 hasn't. Is there a function that tells you if a certain position in a cell array exists? Please note that it should also work with more than two cell arrays that have different numbers off cells.
The file with the Data from the cell arrays is supposed to look like this:
M103
M103
M103
M103
M103
M103
M103
G00 X0 Y0
G00 X0 Y0
G00 X0 Y0
G00 X0 Y0
G00 X0 Y0
G00 X0 Y0
Q1=30 F0
Q1=30 F0
Q1=30 F0
Q1=30 F0
Q1=30 F0
Q1=30 F0
Q1=30 F0
Q1=30 F0
G01 X0 Y0 F0
G01 X0 Y0 F0
G01 X0 Y0 F0
G01 X0 Y0 F0
G01 X0 Y0 F0
G01 X0 Y0 F0
I'm looking forward hearing from you. I'm currios what solution you propose.
Best
Tim
Answers (1)
Tim Felix Liesching
on 12 Mar 2021
Categories
Find more on Low-Level File I/O 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!