フィルターのクリア

Multiplying multiple variables within an equation

4 ビュー (過去 30 日間)
Stuart
Stuart 2011 年 11 月 21 日
Hi,
Really simple question, but with not using Matlab for the last 2 years I've forgotten and I can't find the answer anywhere.
I'm trying to solve an equation of motion, with a varying initial velocity and angle theta.
I want the velocity (u) to vary between 0 and 10ms^-1 in 0.5 increments so typed in: u=0:0.5:10. I then did the same for theta between 0 and 90 degrees theta=0:1:90
The equation is:
y= ((u^2)*(sin^2(theta))/(9.81*2)
What I was expecting was 91 values for y for every value of u, however I keep getting a error message "mtimes: inner matrix dimensions must agree"
Can anyone tell me where I've gone wrong?
Thanks for your help.

採用された回答

David Young
David Young 2011 年 11 月 21 日
y = (u.').^2 * sin(theta).^2/(9.81*2);
gives you 21 x 91 matrix, where each row corresponds to one of the u values, and each column corresponds to one of the theta values.
  3 件のコメント
James Tursa
James Tursa 2011 年 11 月 21 日
u' = conjugate transpose
u.' = transpose (no conjugate)
Stuart
Stuart 2011 年 11 月 21 日
Brilliant. Thanks for your help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by