필터 지우기
필터 지우기

What is the correct equation?

조회 수: 1 (최근 30일)
Kevin Chapman
Kevin Chapman 2019년 1월 30일
답변: Walter Roberson 2019년 1월 30일
>> t=linspace(0,2*pi,100);
>> y=5*t.*(sin(t).^2)-t.^2*(cos(t).^2);
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 '.*'.
The equation I'm trying to input is: y=5*t*sin^2(t)-(t^2)*cos^2(t)

채택된 답변

Walter Roberson
Walter Roberson 2019년 1월 30일
y=5*t.*(sin(t).^2)-t.^2.*(cos(t).^2);
You should probably get in the habit of always using .* and .^ and ./ every time, until you finally encounter a situation where you need to use inner product * or matrix exponential ^ or least squared solutions to equations /

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by