horzcat-error in subs for certain values
古いコメントを表示
Hi everyone,
has anyone an idea on the following problem? I tried to create a minimal example of the problem. But in any more simple form the error does not show up. I wanted to do some matrix algebra and find eigensolutions that match a certain condition. For this i wrote:
syms c a alpha;
A = [ ...
1 , 2*a + 40/2.23; ...
0 , 1 ...
];
B = [ ...
1 , 0; ...
-2/50 , 1 ...
];
C = [ ...
1 , c + (2*a+40+c)/cos(2*alpha); ...
0 , 1 ...
];
D = B*C*B*A;
zr = sqrt(4-(D(1,1)+D(2,2))^2)/(2*D(2,1))-3.15;
z = (D(1,1)-D(2,2))/(2*D(2,1));
laenge = 19;
winkel = 13;
kante = double(solve(subs(zr,[a, alpha],[ laenge , winkel * (pi/180)]) , c));
q = 1/complex(subs( z , [a,alpha,c] , [laenge,winkel*(pi/180),kante] ),opt)
Running this code, i will get a solution without problems. But if i change the variable 'winkel' a little to 13.2 it results in the error
'Error using horzcat. CAT arguments dimensions are not consistent.'
which is pretty weird for me. I was thinking whether my equations maybe don't have solutions for these parameters, but i solved it with the same parameters in mathematica without any problems. Anyone has an idea what i did wrong?
Thanks for your help.
Regards
2 件のコメント
Jan
2014 年 2 月 26 日
Please post the complete error message, which contain a hint to the corresponding line also!
Walter Roberson
2014 年 2 月 27 日
Also, please show size() of all variables that appear in the line that is giving the error.
回答 (1 件)
カテゴリ
ヘルプ センター および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!