MATLAB: To store elements with different datatypes from loop

different data typesloopstore array

Hello my seniors, Could you please help me because I have faced some problems to store elements with different data types.I want to store double array ,structure array that I calculated from loop . How can I store these heterogeneous data types . Thanks all ……

Best Answer

Use cell arrays
M{1}=[1 2 3];
M{2}=5
M{3}='text'