フィルターのクリア

dimensions not consistent when trying to save to a matrix

1 回表示 (過去 30 日間)
franz
franz 2012 年 4 月 24 日
Hi! I'm using ode45 to get coordinates from a sphere and I want save them in a matrix, the code is:
np=16;
[X,Y,Z]=sphere(np);
w=0.6;
X=-6+w*X;
Y=1+w*Y;
Z=-1+w*Z;
tot=[];
for i=1:289
[T,xyz]=ode45('odebc',[0 15],[X(i) Y(i) Z(i)]);
tot=[tot xyz];
end
and the ode45 functions works but when I try to save it in tot I get CAT arguments dimensions are not consistent. Is there a better way to solve this? I don't know if you need the function code aswell? anyway thanks in advance

採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 4 月 24 日
tot=[tot; xyz(:)];

その他の回答 (1 件)

Siddharth Pande
Siddharth Pande 2012 年 4 月 24 日
convet it into the same fromat use "whos" to see the dimentions and then interchange the dimentions if they are not alike

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by