Incorrect dimensions for matrix multiplication.

5 visualizaciones (últimos 30 días)
jenella jiang
jenella jiang el 21 de Jul. de 2020
Respondida: David Hill el 21 de Jul. de 2020
((exp(x-4))*(x.^2)-x+1)/(2+cos(5*x))
Error using *
Incorrect dimensions for matrix multiplication.
Check that the number of columns in the first matrix
matches the number of rows in the second matrix. To
perform elementwise multiplication, use '.*'.
Error in Trapezoidal (line 18)
y=((x.^2)*exp(x-4)-x+1)/(2+cos(5*x));

Respuestas (1)

David Hill
David Hill el 21 de Jul. de 2020
y=((x.^2).*exp(x-4)-x+1)./(2+cos(5*x));%you likely want element-wise operations .* and ./

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by