The reason for errors obtained in above function
- As mentioned in the question to get 3×3 tiledlayout, but in the code it is initialized for 5×5
- The main reason for second error is tiledlayout should be initialized outside the for loop
- The reason for first error might be data sent to function is not handled properly in for loop.
You can use something like below:
a={{[1,2,3,4],[5,6,7,8]},{[7,8,9,10],[11,12,13,14]}};
tiledlayout(2,2)
for i=1:numel(a)
ele=a{1,i};
for j=1:numel(ele)
newele=ele{1,j};
nexttile
plot(newele);
end
end
You can customize accordingly.