Looping and saving or copying a 1xn structure content to Mat files

17 views Asked by At

I have an 1xn structure with structure fields and I want to loop through the structure and copy or save the fields of each structure to multiple 'mat files'. Any help or assistance will be appreciated. The example below demonstrates what I have as inputs. I want a mat file containing the fields of the first row and another mat file containing the fields and components of the next etc...

I tried to save and copy through the loop, but the syntax seems not to be the right one:

for i=1:2
  save mat1(i).mat s(i).p s(i).r s(i).su
  copy mat2(i).mat s(i).p s(i).r s(i).su
     end
0

There are 0 answers