MATLAB Answers

0

Read files with lat Long values ?

Asked by Adrij Roy on 18 Feb 2019 at 20:20
Latest activity Edited by per isakson
on 18 Feb 2019 at 22:35
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!

  0 Comments

Sign in to comment.

Products

1 Answer

Answer by per isakson
on 18 Feb 2019 at 22:24
Edited by per isakson
on 18 Feb 2019 at 22:35

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}]

  0 Comments

Sign in to comment.