How to get a vector of numbers from a matrix for a list of selected locations?

1 回表示 (過去 30 日間)
Alon Rozen
Alon Rozen 2020 年 2 月 9 日
コメント済み: Alon Rozen 2020 年 2 月 9 日
Hi,
Suppose I have a matrix of numbers/logicals.
I have a set of pairs of indices (i,j) pointing to some matrix entries .
I want a vector of numbers/logicals from the matrix in these (i,j) indices.
Of course, I can write a for loop and get the number/logical in each matrix entry.
Is there a more efficient way to get this done? Without a loop?
Thanks,
Alon
  2 件のコメント
Alon Rozen
Alon Rozen 2020 年 2 月 9 日
Stephen thanks :)
I didn' know about this function.
So simple!
Alon

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

回答 (0 件)

カテゴリ

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

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by