how to select the required value from among all values
1 次查看(过去 30 天)
显示 更早的评论
If I am having the data as
1 2 3
4 5 9
6 6 12
6 3 9
10 11 21
.
.
.
4 6 10
where the first and second number add to give the third number for all the combinations
if i need to choose the addition of two values that gives the result 9 ,and suppose there are two possibilities how to choose any one of the possibility.
could anyone please help me on this.
3 个评论
回答(1 个)
Walter Roberson
2019-4-14
row9 = find(YourData(:,3) == 9);
one_of_them = row9( randi(length(row9)) );
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!