Assign one array elements as values to another array

A = [111,222,333,....] is 1x48 matrix B = [-13,3,4,35,....] is 1x 48 matrix
i want to assign values of B array to A like wherever 111 is there 111=-13,222=3,etc..........
thank you

回答 (1 件)

Matt J
Matt J 2012 年 11 月 15 日

2 投票

A=B;

1 件のコメント

Jan
Jan 2012 年 11 月 15 日
編集済み: Jan 2012 年 11 月 15 日
It seems like this answers the question already. Although this is longer than my favourite answers "yes" and "no", the compactness of this solution cannot be better. +1

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

カテゴリ

ヘルプ センター および File ExchangeOperators and Elementary Operations についてさらに検索

質問済み:

sp
2012 年 11 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by