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에서 Numeric Solvers에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!