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 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
John D'Errico
il 31 Mag 2016
Please learn to format your posted code so it is readable. Learn to use the "{} Code" button.
Risposte (1)
John D'Errico
il 31 Mag 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 Commenti
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!