How to get a bathymetric map from .txt file

3 ビュー (過去 30 日間)
Kelto7
Kelto7 2019 年 10 月 14 日
回答済み: Abhilash Padma 2019 年 11 月 5 日
Hi, I'm not a proper user of Matlab, so I apologize for my question, maybe the answer is obvious. I have a .txt file (attached) that represents the bathymetry of a certain grid, as shown in the figure. The grid has two orthogonal coordinates, that are M (74 cells) and N (133 cells). The file organizes the depth data in this way: it considers all the 74 values along the M direction, for N=1. Then again, for N=2, the next 74 values of M direction are furnished, and go on (positive values represent water depth, negative values land ground, -999 represent no data).
Grid_74x133.png
My goal would be to be able to get the information of depth from .txt file and use them on a grid, in order to represent the bathymetry through a X, Y, Z scheme (then by meshgrid, contour commands). I am anyway stuck on the basic process, which is how to read the data. I would be really thankful if anyone could give a help!

採用された回答

Abhilash Padma
Abhilash Padma 2019 年 11 月 5 日
Use “fscanf” method to read data from a text file. Refer the following documentation:https://in.mathworks.com/help/matlab/ref/fscanf.html

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeology についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by