How can I extract multiple arrays from one .dat file?
2 views (last 30 days)
Show older comments
I have a Fortran 90 model that outputs N arrays (currently 8 but will rise to hundreds) into one unformatted .dat file. I need to import the arrays into MATLAB so that I can plot them. I can only get MATLAB to find the first array and I cannot find a way to get all of the arrays read and available for plotting. Each array has been assigned a title by Fortran so the arrays are of the form:
Title
A B C D
E F G H
I J K L
M N O P
Title2
A B C D
etc...
The arrays that I am working with are much larger though.
Each number in the array is separated by a space as opposed to a tab or comma.
I have attempted to use the functions dlmread, load and csvread with little avail. I was hoping that someone could give me some pointers as to where exactly I am going wrong or if there was something that I was missing.
Thank you very much for your time.
Regards
Tom
2 Comments
Jonathan Epperl
on 9 Nov 2012
textread and textscan are 2 functions that might help you, they're a little more versatile than csvread.
Answers (0)
See Also
Categories
Find more on Text Files 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!