Combine ascii files of different size

1 visualizzazione (ultimi 30 giorni)
PK
PK il 28 Lug 2015
Risposto: Azzi Abdelmalek il 28 Lug 2015
Hi everybody. I am rather new in Matlab hope that someone can provide me help or a link with a probably very naive question. I have three different files (longitude, latitude and depth). The files have different sizes but the same format. I want to combine them to a single file. I give a simple example. Lon= -180 10 Lat= -90 0 60 Depth= 1 2 3 4 5 6
At the end I want to have something like this: lon lat depth -180 -90 1 10 -90 2 -180 0 3 100 0 4 -180 60 5 10 60 6
My files are much larger. I have more files thats why I need kind of an automatised way.
I thought that I probably should make use of loops. I would be happy about any hint.
Cheers PK

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 28 Lug 2015
Lon= [-180 10]
Lat= [-90 0 60]
Depth= [1 2 3 4 5 6]
[ii,jj]=ndgrid(Lon,Lat);
out=[ii(:) jj(:) Depth']

Più risposte (0)

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by