MATLAB Answers

Passing a vector through a built in function?

1 ビュー (過去 30 日間)
Brian Bowne
Brian Bowne 2019 年 11 月 21 日
Answered: Star Strider 2019 年 11 月 21 日
Hello,
I am passing two vectors through and equation, but am getting a scalar output. The equation is as follows:
V=sqrt((2*W*cosd(theta))/(CL*p6000));
W and p6000 are constants.
theta and CL are vectors, of the same length.
When I run the code as is seen above, I get a scalar output instead of a vector. When I try to use the dot operator, i get an error saying matrix dimensions do not agree.
How do you fix this?
Thanks

  0 件のコメント

サインイン to comment.

採用された回答

Star Strider
Star Strider 2019 年 11 月 21 日
Do element-wise multiplication and division:
V=sqrt((2*W.*cosd(theta))./(CL*p6000));
See: Array vs. Matrix Operations for an extended discussion.

  0 件のコメント

サインイン to comment.

More Answers (0)

サインイン してこの質問に回答します。

タグ


Translated by