Info

此问题已关闭。 请重新打开它进行编辑或回答。

If elements one array meet condition, use data in same element position in second array

2 次查看(过去 30 天)
Lets say I have an array of bearing angles such as: [0, 90, 0] and I want to use elements a that are equal to zero. I then want to use the data in another array of displacments [10, 10, 20], that are in the same positions as the angles that meet the condition in the first array. Im not sure how to do this, I figured out how to use the displacment and angle to then find x and y coordinates Im just not sure how to do this.
  1 个评论
That Guy
That Guy 2020-11-14
note that these are just example arrays, im trying to write a code that i can use for different angle conditions, but I know how to do that portion im pretty sure.

回答(1 个)

Ameer Hamza
Ameer Hamza 2020-11-14
编辑:Ameer Hamza 2020-11-14
a = [0, 90, 0];
b = [10, 10, 20];
y = b(a==0)
Result
>> y
y =
10 20

此问题已关闭。

标签

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by