Reading multiple variables in workspace named sequentially and writing to text file.
1 view (last 30 days)
Show older comments
Hi, I have data with six columns and I would like to read them in a loop, perform the row index given by;
row_idx = (hr == M(:, 2) & -40 <= M(:, 3) & M(:, 3) <= 0 ...
& 135 <= M(:, 4) & M(:, 4) <= 180 | (-180 < M(:, 4) ...
& M(:, 4) <= -120));
filtered_M = M(row_idx, :).
where M is a dummy variable which has been assigned value of a variable, and hr is the hour (which I will already assign as a global variable).
The variables are named as A(year)(month)(day) eg, A20130101 for data of 1st January 2013.
I would like to read the variables, perform the row index, and write the number to rows in resulting matrices into a text file.
I have difficulty reading the variables and then writing the number of rows in the resulting matrices in a text file.
1 Comment
Geoff Hayes
on 16 Oct 2014
Ashneel - what difficulty are you experiencing in reading the variables? What code have you written so far?
Answers (0)
See Also
Categories
Find more on Data Import and Export in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!