1

I was reading that in MatLab, if you are going to fill a larger matrix, its more computational efficient to declare it's size from before with the use of the cell command; E.g.

X = cell(500,90);

but when I try to add values to it, like

X(i;) = x

where i is vector of double of length 90, and i an integer, I get

conversion from cell to double is not possible

Is my understanding of the cell function correct?

4

1 に答える 1

1

セルの内容は、中かっこを使用してアドレス指定されています。次に例を示します。

X{1,1}=1:8;

cellコマンドは空の配列を作成します:

C = cell(3,4,2);
% Or alternatively:
C{3,4,2} = [];

で何をするかはcell arrayあなた次第です。しかし、おそらくそれはあなたが望むものではありません.Rasmanのコメントを参照してください.

MathWorksまたは他のチュートリアルで、さらにいくつかの例を見てください。

于 2012-04-04T14:50:46.270 に答える