Plotting multiple trajectories on map
Ältere Kommentare anzeigen
I have a rather strange one.
I need to plot multiple trajectories on a map. Right now, I am manually adding each latitude and longitude to the script and plotting away. This is easy enough for a few lines, but not in the long run.
The variables tdump* are specific to a trajectory and are from individually named text files. So... these change depending on the text file. What I have been doing is importing the information I need from each text file and assigning it a numeric variable with the same name.
%Import data from file. Get rid of ugly header.
filename = 'tdump85072712.txt';
delimiterIn = ' ';
headerlinesIn = 12;
C = importdata(filename,delimiterIn,headerlinesIn);
%To assign certain columns to a specific variable
tdump85072712 = C.data(:,9:12);
I then go on to plot each onto a map.
figure
lima ('xy') %Plots a stereographic map
plotps(tdump85072506(:,2),tdump85072506(:,3),'r-')
plotps(tdump85072512(:,2),tdump85072512(:,3),'color', [0 .498 0],'linestyle','-')
plotps(tdump85072518(:,2),tdump85072518(:,3),'k-')
plotps(tdump85072600(:,2),tdump85072600(:,3),'color', [.306 .396 .58],'linestyle','-')
plotps(tdump85072606(:,2),tdump85072606(:,3),'m-')
plotps(tdump85072612(:,2),tdump85072612(:,3),'b-')
plotps(tdump85072618(:,2),tdump85072618(:,3),'y-')
...
Does anyone know of an easier way to achieve the same thing?
Akzeptierte Antwort
Weitere Antworten (1)
Kategorien
Mehr zu Data Type Identification finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
