Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Error using * Inner matrix dimensions must agree.

2 visualizaciones (últimos 30 días)
Anne Louise Barão
Anne Louise Barão el 25 de Nov. de 2019
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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

Respuestas (1)

Walter Roberson
Walter Roberson el 25 de Nov. de 2019
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.

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by