Incorrect dimensions for matrix multiplication.

조회 수: 2 (최근 30일)
jenella jiang
jenella jiang 2020년 7월 21일
답변: David Hill 2020년 7월 21일
((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));

답변 (1개)

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

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by