how to solve this error ?
이전 댓글 표시
Hi
I have this function then m and k are an input matrices having dimension (12,12) but an error message is displayed
like : Error using *
Inner matrix dimensions must agree.
Error in equabeam1 (line 9)
xdot = A*x+B*f;
Error in @(t,x)equabeam1(t,x,m,k)
Error in odearguments (line 87)
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
function xdot = equabeam1(t,x,m,k)
% Function file for mass with spring.
% Position is first variable, velocity is second variable
freq=100; %frequency (Hz)
w=2*pi*freq;
A = [zeros(12,12),ones(12,12);-m^-1*k,zeros(12,12)];
B = [zeros(12,1);m^-1*ones(12,1)];
f =sin(w*t);
xdot = A*x+B*f;
end
[m,k,idof]=beam1(node,elt,pe,ie,opt)
[t,x] = ode45(@(t,x) equabeam1(t,x,m,k),[0,10],[0,0])
figure;
plot(t,x(:,1))
Please help me
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Stress and Strain에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!