Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

compare and save data

Asked by Lalit Patil on 6 Nov 2012

http://www.fileconvoy.com/dfl.php?id=g645815cb6847f60f1668697c4e61c1bb29e057

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..

0 Comments

Lalit Patil

Products

1 Answer

Answer by Pedro Villena on 6 Nov 2012
Edited by Pedro Villena on 6 Nov 2012
Accepted answer
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 Comments

Pedro Villena

Contact us