error when using {}

12 ビュー (過去 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 Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by