필터 지우기
필터 지우기

Extracting data from matrix row vector

조회 수: 2 (최근 30일)
Sag
Sag 2016년 1월 21일
댓글: Star Strider 2016년 1월 22일
I have a double Streams with some process I have got vector F which has a value Now I want to go back to the Streams and locate value matching value of F; get 100 columns forward and collect all the data between those two columns. I tried with ismember to locate the position of F in Streams but no success
Data=Streams(J: (J-2544))%does not work

채택된 답변

Star Strider
Star Strider 2016년 1월 21일
MATLAB by default increments using the colon ‘:’ operator. If you want it to decrement, you have to tell it specifically to use a negative step.
See if this does what you want:
Data=Streams(J : -1 : (J-2544));
Notice the ‘-1’ step.
  댓글 수: 8
Sag
Sag 2016년 1월 22일
Still there is Warning: Integer operands are required for colon operator when used as index for code Final=Streams(J: +1 : (J+2544)); But the data looks okay Just wanted to know that would above warning affect the data analysis.. Thanks!
Star Strider
Star Strider 2016년 1월 22일
If you cannot address your data arrays correctly, it could affect your data analysis.
‘J’ still needs to be an integer to create your subscript vector.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by