필터 지우기
필터 지우기

Info

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

need help with arrays

조회 수: 2 (최근 30일)
shru s
shru s 2017년 6월 8일
마감: MATLAB Answer Bot 2021년 8월 20일
Suppose I have two arrays or two constants with many values in each. Let them be A and B. Length of A is longer than length of B. If A is a continuous sequence of numbers(from 1 to a value) and all values that B contains do exist in A, want a for loop running through values of A, and everytime a value is come across that exists in B an action takes place, and when it doesnt exist another action takes place. Kindly help me out. Thank you.
  댓글 수: 2
Adam
Adam 2017년 6월 8일
doc ismember
will give you a logical array of results which you can then loop around if you wish (or use a vectorised function, depending what subsequent action you want to do) to perform your actions.
shru s
shru s 2017년 6월 8일
Thank you so much! You dont know how much you have helped me by suggesting this! I am extremely grateful! You are awesome!!!

답변 (0개)

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

Community Treasure Hunt

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

Start Hunting!

Translated by