selecting values from matrix
显示 更早的评论
Hi everyones,
I explain my question with an example :
q2 is obtained from an equation
A=[r1 r2 r3;q1 q2 q3;k1 k2 k3];
I want to select proportional row values (r2 and k2).
what should I do?
Thanks.
采纳的回答
更多回答(1 个)
the cyclist
2015-11-23
Here's one way:
idx = A(2,:)==q2;
values = A([1 3],idx);
3 个评论
Hamid
2015-11-23
the cyclist
2015-11-23
Maybe Star Strider's answer works for you? If not, then I would say you should start over with a new question, and fully specify the general problem.
Hamid
2015-11-23
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!