how do i select a line but not all ?
조회 수: 2 (최근 30일)
이전 댓글 표시
sharifah shuthairah syed abdullah
2018년 11월 14일
댓글: sharifah shuthairah syed abdullah
2018년 11월 14일
i need a help
how do i write a code when i want to use a certain number in line.. for example i have this set of solutions
RS =
1 29374 11 6 5 7 1 4 3 10
2 33444 10 2 4 6 7 1 3 8
3 38346 3 7 12 8 4 10 11 9
4 39010 3 10 1 7 11 5 4 8
5 41420 12 11 7 5 1 6 9 8
6 44168 12 10 4 6 3 5 11 7
7 46220 2 11 6 5 12 3 9 8
8 47074 8 11 1 7 5 4 6 2
9 51854 7 8 2 5 1 12 11 4
10 52194 7 9 2 5 11 1 10 3
i want to choose line 1 and 2 and 9 and 10 so i did it like this
P1 = RS(1,:)
P2 = RS(2,:)
P3 = RS(9,:)
P4 = RS(10,:)
from this i get my answer like this
P1=
1 29374 11 6 5 7 1 4 3 10
P2=
2 33444 10 2 4 6 7 1 3 8
P3=
9 51854 7 8 2 5 1 12 11 4
P4=
10 52194 7 9 2 5 11 1 10 3
however i only want to used from line 3 until last
how do i code that to that i just get my answer like this
P1=
11 6 5 7 1 4 3 10
P2=
10 2 4 6 7 1 3 8
P3=
7 8 2 5 1 12 11 4
P4=
7 9 2 5 11 1 10 3
can someone help me?
댓글 수: 0
채택된 답변
Cris LaPierre
2018년 11월 14일
I would suggest going through chapter 5 of MATLAB Onramp. It shouldn't take too long and would really help you out.
In the meantime, the short answer is to include in your command the range of data you want to extract:
P1 = RS(1,3:end)
...
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!