error when using {}

11 views (last 30 days)
Arif
Arif on 12 May 2024
Answered: Matlab Pro on 12 May 2024
Hi guys, im trying to run a software by Matlab and do some analysis for some models and this 'Periodandfrequencies' is an example of some results. But I am facing error when I want to keep the result inside the cell-array. Basicaly I want it to be iix1 cell aray and each cell is 12x7 Table.

Answers (1)

Matlab Pro
Matlab Pro on 12 May 2024
Hi
What you are doing is wrong:
You have a variable called "Periodandfrequencies" which is a "table" (defined on line #335 @ your code)
but on the next line - you relate is a a cell.
The solution is easy - create another variable, of type cell (with the dimentions iix1) that will hold the tables:
Periodandfrequencies_container is a cell array. Each cell of it contains a table of size 3x4
iMax = 5;
Periodandfrequencies_container = cell(iMax,1);
for ii = 1:iMax
A = rand(3,4);
Periodandfrequencies = array2table(A);
Periodandfrequencies_container{ii,1} = A;
end

Categories

Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!