Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Error using * Inner matrix dimensions must agree.
조회 수: 4 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
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.
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!