I would like to nest an n x m matrix into a table, by using a for loop to populate each row of the table with a corresponding matrix. I am running matlab 2018a. Below you can find example code:
% create the table subject = [1; 2; 3; 4]; condition = {'cond1';'cond2';'cond3';'cond4'}; data = NaN(4,1); T = table(subject,condition,data); % populate the table with matrixes, using a for loop for i = 1:1:size(T,1) data = rand(10,5); T.data(i) = data; % ERROR Unable to perform assignment because the left and right sides have a different number of elements. end
I thought it was possible to create nested tables. However, I am not sure, on account of the error. I know tables within tables exists, but I am unsure whether you can nest a matrix/array in a table. Therefore, it is also allowed to transform the data matrix to a table, and then nest the table in the table. Of importance, I want to retain the for loop mechanism to populate the table.
data = cell(4,1);
And
T.data{i} = data;
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.