Read files with lat Long values ?

3 views (last 30 days)
Adrij Roy
Adrij Roy on 18 Feb 2019
Edited: per isakson on 18 Feb 2019
Hello everyone,
I got a problem with reading files from a directory which has files named as data_lat_lon.
The data analysis part is for different districts which have more than latitude & longitude values.
If only one lat/long pair were there, it would be simpler to relate each pair wit other data such as temperature.
But for different lat/long pairs for a district, I need to create a for loop which will run through
y = 1:length(either lat or long).
The files will be searched from the directory as:
dlmread('H\Adrij\documents\data_','_',lat{y,1},'_',lon{y,1})
I am getting serious error!

Answers (1)

per isakson
per isakson on 18 Feb 2019
Edited: per isakson on 18 Feb 2019
The comma delimited list of character vectors
'H\Adrij\documents\data_','_',lat{y,1},'_',lon{y,1}
must be replaced by ONE string (or character vector). (I assume that lat and lon contain array vectors.) Enclose the list in brackets to concatenate the pieces
['H\Adrij\documents\data_','_',lat{y,1},'_',lon{y,1}]

Categories

Find more on Structures in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!