How to combine two matrix based on position and find the corresponding element?

5 次查看(过去 30 天)
I am having two matrix. one matrix element represent the position whereas other matrix contine the elements. Now i have to merge these two matrix based on position and to find corresponding element.
for example:
a=[ 5 6 3 7]
b=[011 101 010 001 100 110 111]
expected output:
c=[100 110 010 111]
i need to apply this problem to a larger n*m matrix.

采纳的回答

the cyclist
the cyclist 2022-4-26
  3 个评论
ASHA PON
ASHA PON 2022-4-28
Thank you for your reply. But while applying this condition, only one bit from binary element is displayed as output.
otained output:
0
1
1
1
expected output:
010
100
110
111

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by