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 (최근 30일)
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...

채택된 답변

Image Analyst
Image Analyst 2019년 4월 21일
To compare, use subtraction or the usual comparitive operators like ==, >=, <=, and ~=.
  댓글 수: 1
harman bhaveja
harman bhaveja 2019년 4월 21일
No, I wanted to know how do I use the for loop to check if the flights have 70% of their data within the path(s) and then if they do, store the flight number, and the path number within another excel sheet.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by