Re: The concept of a record
- From: Gordon Sande <g.sande@xxxxxxxxxxxxxxxx>
- Date: Thu, 31 Jan 2008 14:31:53 GMT
On 2008-01-30 22:08:49 -0400, qsc <qingshan.chen@xxxxxxxxx> said:
On Jan 30, 3:18 pm, Gordon Sande <g.sa...@xxxxxxxxxxxxxxxx> wrote:
The values that are in the record come one after the other.
The structure of (1,n) or (n,1) is an artifact of your program.
There will usually be some documentation on how the sequence
of values corresponds to your structure. RTFM (Read The Fine
(or F***ing accoding to some folks) Manual)!
In Fortran you will find a correspondence that says the first subscript
varies most rapidly. It only matters if there are several (like 2) subscripts.
Other languages might choose to vary the last subscript most rapidly.
Fortran is the oldest commonly used language so it should be treated
deferentially with its choice preferred notwithstanding the opinions
of some upstart newcomers.
In your example both structures lead to the same sequence of values.
So the answer it is both! If you had some other value than 1 the answer
would be something else. But you may find that MatLab does not understand
Fortran records.
Hi Gordon,
I know this part of knowledge about Fortran. My question should have
been put this way: with X written out as in the example, what shape
would it be of the matrix A = fread(fid)? Here fread is the matlab
command. For a matrix in matlab, the shape (n,1) and (1,n) look
visually differently, although internally they may both be stored as a
sequence of numbers in the memory. It turns out that the matrix has
the shape (n,1).
You are right to notice that they are different visually and that the
difference may not matter for the internal storage. Likewise for the
external storage.
A Fortran newsgroup is not a good place to ask about MatLab. Some folks
here may know about Matlab but most do not. Much better to try someplace
like comp.soft-sys.matlab which shows up in the list of newsgroups when
I do a search of them for matlab. The folks there are much more likely
to know about the foibles of file input to MatLab.
MatLab presumably has a manual and you should RTFM! Funny facts like dealing
with storage are what manuals are all about. Boring as hades but bloody
useful when you actually need to do something. If you can find an electronic
copy you might even use an apropriate find command to locate relevant sections
assuming you can guess good keywords.
.
- References:
- The concept of a record
- From: qsc
- Re: The concept of a record
- From: Klaus Wacker
- Re: The concept of a record
- From: qsc
- Re: The concept of a record
- From: Gordon Sande
- Re: The concept of a record
- From: qsc
- The concept of a record
- Prev by Date: Re: Did anyone manage to get MATRAN compiled with g95?
- Next by Date: Re: computing Bernoulli numbers
- Previous by thread: Re: The concept of a record
- Next by thread: Re: The concept of a record
- Index(es):
Relevant Pages
|
|