What is wrong with the code? I am getting an error as ' Input should be vector ' ?? I have a second order polynomial of omega were the coefficients are 32x32 matrices. I have written two codes for the same.both with errors.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
m1=zeros(24,8); m2=zeros(8,24); m3=zeros(8,8); M=[Mxx m1;m2 m3]; D1=zeros(24,24); D2=zeros(24,8); D=[D1 D2 ; Dtx Dtt]; k1=zeros(8,24); k=[Kxx -Kxt; k1 Ktt]; i=sqrt(-1); syms omega %code1: a=-1.*M; b=i.*D; c=k; p=[a b c]; omega=roots(p); %code2 % eqn= -(omega^2).*M+(i*omega).*D+k; % omega=solve(eqn==0,omega,'ReturnConditions', true);
1 comentario
John D'Errico
el 31 de Mayo de 2016
Please learn to format your posted code so it is readable. Learn to use the "{} Code" button.
Respuestas (1)
John D'Errico
el 31 de Mayo de 2016
It would help if you actually reported the ENTIRE error message. Without that, I will only guess.
Does roots handle problems with entire matrices of coefficients? No. Roots will tell you something to the effect that the input argument should be a vector.
Use a loop if you have entire sets of problems to solve.
0 comentarios
Ver también
Categorías
Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!