how do i correct my q command

T=2226.92;
t=[0:10:T/2];
% let h(t) be m
m= (4930-2.2136*t).^2/5;
%let h'(t) be n
n=9662.849*t-4365.2192;
%let v'(t) be q
q=pi*m.^2*n;
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 '.*'

回答 (1 件)

Star Strider
Star Strider 2020 年 1 月 3 日

1 投票

Do element-wise multiplication (the dot operator):
q=pi*m.^2.*n;
↑ ← HERE

この質問は閉じられています。

質問済み:

2020 年 1 月 3 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by