error when using {}

11 次查看(过去 30 天)
Arif
Arif 2024-5-12
回答: Matlab Pro 2024-5-12
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.

回答(1 个)

Matlab Pro
Matlab Pro 2024-5-12
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

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by