Extracting values from ployshape class

49 views Asked by At

enter image description here

I have a .mat file in which there are 192 polyshape and in each polyshape there is a matrix of [16*2] double

I want to extract all those [16*2] double values from each polyshape and store it into .csv file

1

There are 1 answers

0
Zenin Easa Panthakkalakath On

I think you should be able to concatenate all the vertices matrices and use 'writematrix' function to write a double matrix into a CSV file. I assume that there is a variable named 'polyshapes' which is an array of all the 192 polyshape data you have. Then you can run the following.

a = [];
for i = 1:192 % Loop to concatenate
    a = [a; polyshapes(i).Vertices];
end
writematrix(a,'filename.csv');

Regards, Zenin