필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to compare and copy the value of one vector to another?

조회 수: 1 (최근 30일)
Aswin Sandirakumaran
Aswin Sandirakumaran 2018년 5월 24일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a VECTOR A = [0,540] and B = [60,600,15]
Lets say i have
index = 1 for A(1) = 0
index = 3 for A(2) = 540
So
it should A vector should compare with B
*index 1 of A = index 1 of B
index 3 of A = index 3 of B
But index 2 of A IS NOT PRESENT SO IT SHOULD TAKE INDEX 2 of B and put it in A as INDEX 2 of A*
SO FINAL OUTPUT SHOULD BE LIKE THIS: A = [0,600,540]
IF INDEX OF A VECTOR CHANGES THEN IT SHOULD TAKE APPROPRIATE INDEX WHICH IS MISSING in A and it should copy the missing index value from B vector AND ADD IT IN THAT PLACE!
  댓글 수: 2
Image Analyst
Image Analyst 2018년 5월 24일
Sorry but index 2 of A IS present. It is 540 in your example. 540 is not index 3 as you said. I don't understand what rules you're trying to follow. And what is the role of the 15 in B? Does the 15 just get ignored? And is this your homework? It seems quirky enough of a request to be homework.
Aswin Sandirakumaran
Aswin Sandirakumaran 2018년 5월 25일
Nope this isnt homework. It is just an idea to implement and use it my algorithm

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by