How to convert grid file to text file?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
hanif hamden
am 28 Jun. 2020
Bearbeitet: Walter Roberson
am 5 Jul. 2020
Hi there.
Can you help me on how to convert this type of grid file into text file (lat, lon, amp, phase) for each column.
The grid file is attached
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 28 Jun. 2020
fid = fopen('Example.txt');
data = cell2mat(textscan(fid, '', 'HeaderLines', 5));
fclose(fid);
amps = data(1:2:end,:);
phases = data(2:2:end,:);
[nr, nc] = size(amps);
longs = linspace(0, 360, nc+1);
longs(end) = [];
lats = linspace(-90, 90, nr+1);
lats(end) = [];
subplot(2,1,1);
surf(longs, lats, amps);
xlabel('long')
ylabel('lat')
title('amplitudes')
subplot(2,1,2)
surf(longs, lats, phases)
xlabel('long')
ylabel('lat')
title('phases')
9 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu String finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!