How to define range for angle

20 ビュー (過去 30 日間)
farheen asdf
farheen asdf 2015 年 8 月 28 日
コメント済み: Star Strider 2024 年 11 月 14 日 21:12
I have two angles theta1 and theta2 such that 0<theta1<pi/2 and 0<theta2<pi How do I define these angles in Matlab? I have used theta1=0:pi/2; theta2=0:pi;
but the problem is that further down in the task i need to use (theta1+theta2) which is not possible since by above range theta1 and theta2 have different dimensions.

採用された回答

Star Strider
Star Strider 2015 年 8 月 28 日
If you want them both to have the same dimensions, use the linspace function:
theta1 = linspace(0, pi/2, 50);
theta2 = linspace(0, pi, 50);
Both of these have the length determined by the third argument (here 50), producing a (1x50) vector for each one.

その他の回答 (1 件)

Mingwei
Mingwei 2024 年 11 月 14 日 19:25
how to classify the angle into the specified ranges in matlab coding
  1 件のコメント
Star Strider
Star Strider 2024 年 11 月 14 日 21:12
Your quesiton is a bit ambiguous.
See if the discretize function will do what you want.

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

カテゴリ

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