필터 지우기
필터 지우기

read columns from array

조회 수: 47 (최근 30일)
Henry Buck
Henry Buck 2015년 8월 24일
답변: senthil kumar 2015년 8월 27일
Hi there, I need some help of solving that issue: I have 5 different voltage values that change every single tick time - that mean every single moment. I need to sort them and after they been sorted I want to go to another matrix(like this one at the bottom) and to pull out(read) specific column from it. That mechanism change every single states/moment. How can I do this ?
The Matrix look like(and could be greater...):
0 0 0 1 1 1
0 1 1 0 0 1
1 0 1 0 1 0
1 1 0 1 0 0
Thanks, Henry
  댓글 수: 1
Jon
Jon 2015년 8월 24일
You should provide an example since your question is ambiguous. You say you have 5 values at each time, yet your example matrix has no 5-column or 5-row entries.
Look at sort() and sortrows() for sorting. For pulling out the column that you want, type
result = Matrix(:,col_I_want);
If you want to pull a row out, use
result = Matrix(row_I_want,:);

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

채택된 답변

senthil kumar
senthil kumar 2015년 8월 27일
the following command read 2 and 3 column .
result = Matrix(:,2); % read second column result = Matrix(:,3); % read third column.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by