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 view (last 30 days)
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);

Answers (1)

John D'Errico
John D'Errico on 31 May 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.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!