how to select corresponding values to a column
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a data set with x and y...like 100 each in a column...x is a number..y is a value of a paramter
for x i have selected specific values say i have selected 1,15,30,45,60,75,90,100
now i want matlab to select corresponding values of y that are to x...
i know its simple but am dealing with something complex..juts need to know the quick answer. Thanks
댓글 수: 0
채택된 답변
David Hill
2021년 3월 15일
yourMatrix=[(1:100)',randi(100,100,1)];
y=yourMatrix([1,15,30,45,60,75,90,100],2);
댓글 수: 2
David Hill
2021년 3월 16일
yourMatrix=[(1:100)',randi(100,100,1)];
y=yourMatrix(ismember(yourMatrix(:,1),[1,15,30,45,60,75,90,100]),2);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!