How to find a value in matrix column and extract the another column equal to that value?
조회 수: 1 (최근 30일)
이전 댓글 표시

want to find a value from c column(example 35) and want to plot between data in column a and d equal to the value(example 35)
댓글 수: 0
채택된 답변
Akira Agata
2017년 7월 16일
I think the code will be like:
% Sample array
data = randi([30,40],100,3);
% Index where column-2 == 35
idx = data(:,2) == 35;
% Plot column-1 and column-3 under the condition that column-2 == 35
plot(data(idx,1),data(idx,3),'o');
댓글 수: 3
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!