How to check Excel sheet data of one with Excel sheet data of another on matlab and print the output on another Excel sheet
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
harman bhaveja
le 19 Avr 2019
Modifié(e) : harman bhaveja
le 24 Avr 2019
So,
I'm reading a list of flights data from an excel sheet called plot:
journeys = readtable('plot.xlsx');
And I have an ATS route givwen by lat10 and lon10:
lat10 = [12.9933,19.0852]; lon10 = [80.1705,72.8752];
I'm reading the flight data and selecting them based on groups (flight numbers) of flights that have 80% of their data within the ats route:
[x10, y10]= mfwdtran(mstruct,lat10,lon10);
X = [x10,fliplr(x10)];
Y = [y10,fliplr(y10)-d];
%Y = [y10,fliplr(y10)-d];
plot(x10,y10,'-','color','m');%plotting ats
hold on;
plot(x10,y10-d,'-','color','m');%only for 2nd and 3rd batch
%plot(x10-d,y10,'-','color','m');%only for first batch
hold on;
%selecting flights--------------
[journeys.x, journeys.y] = mfwdtran(mstruct, journeys.latitude, journeys.longitude); %transform the flights latitude and longitude
in = inpolygon(journeys.x, journeys.y, X, Y);
[groupid, flights] = findgroups(journeys.flight); %assign unique id to each flight and apply to rows of the table
inratio = splitapply(@(in)nnz(in)/numel(in), in, groupid); %ratio of points in polygon to points in flight
selectedflights = flights(inratio >= .8); %for flights that have 70% of their journey in the polygon
% isallin = splitapply(@all, in, groupid); %are ALL points of the flight in the polygon? logical output
% selectedflights = flights(isallin); %list of flights where all points are in the polygon
selectedjourneys = journeys(ismember(journeys.flight, selectedflights), :); %portion of the table with only the selected flights.
%selecting flights--------------
Now, I have a list of ATS routes in an excel sheet called ATS and I want to compare each flight data with each route that they correspond to. If a flight has 80% of its data within the route I want an excel sheet called Match to have the flight number and the ATS route it matches with.
I'm stuck with this problem from a long time now... kindly help please...
0 commentaires
Réponse acceptée
Image Analyst
le 21 Avr 2019
To compare, use subtraction or the usual comparitive operators like ==, >=, <=, and ~=.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Large Files and Big Data dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!