compare and save data

조회 수: 3 (최근 30일)
Lalit Patil
Lalit Patil 2012년 11월 6일
In this file first column is r, second is c, fourth is R,fifth is C.. I want to find and save all those R,C which are same as r,c.. R,C are pairs and when matching is to do R,C will be compared to r,c..

채택된 답변

Pedro Villena
Pedro Villena 2012년 11월 6일
편집: Pedro Villena 2012년 11월 6일
data=xlsread('Book1.xlsx');
r=data(~isnan(data(:,1)),1);
c=data(~isnan(data(:,2)),2);
R=data(~isnan(data(:,4)),4);
C=data(~isnan(data(:,5)),5);
[flag,index] = ismember([r c],[R C],'rows');
RR = R(index(flag));
CC = C(index(flag));
plot(r,c,'r.',R,C,'g.',RR,CC,'b.');

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by