フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Error using * Inner matrix dimensions must agree.

2 ビュー (過去 30 日間)
Anne Louise Barão
Anne Louise Barão 2019 年 11 月 25 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Não consigo enteder porque aparece esse erro. Só que esse progrma não tem matriz.
clc
w=5.8178; t0 = 1; y1 = 0.05;
m=1200;k=400000;c=21908.88;
wn=sqrt(k/m);
cc=2*m*wn;
eta=c/cc;
wd = wn*(sqrt(1-eta^2));
o = atan((c*w)/k-(m*(w^2)));
n = 100;%pontos a gerar
t = linspace(0,10,n);%vetor tempo
y = y1*(exp(-wn*eta*t))*sin(sqrt(1-(eta^2))*wn*t + o)+((2*y1)/(k*t0))*((t^2)-(c/k))+((-2*y1)/(k*t0))*((t^2)-(c/k))+2*y1;%vetor saida
figure(1),plot(t,y),grid

回答 (1 件)

Walter Roberson
Walter Roberson 2019 年 11 月 25 日
Change all of your * to .* and all of your / to ./ and all of your ^ to .^
In MATLAB, * is algebraic matrix multiplication ("inner product"), and / is matrix division (A/B is much like A*pinv(B)), and ^ is matrix exponential, repeated algebraic matrix multiplication.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by