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일
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 Exchange에서 Logical에 대해 자세히 알아보기

질문:

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