| MATLAB Central > MATLAB Newsreader > Reading from a file in c-mex s-function: odd bug |
|
|
|
Subject: Reading from a file in c-mex s-function: odd bug From: Kate J. Date: 8 Jan, 2012 01:57:08 Message: 1 of 4 |
|
I hate to post a question about a simple syntax bug, but this has really got me stumped: I'm reading in 2 files to my c-mex s-function, both of which contain columns of double values. I've verified that both files have essentially identical formatting, although they contain different data. In my c-mex s-function, I can read from one file with no problem (verified by printing the values read in, to a separate output file). However, although I'm using exactly the same syntax to read in the values from the second file, I get huge nonsense numbers or 0.0000 values for every value being read in, instead of the correct double values. |
|
Subject: Reading from a file in c-mex s-function: odd bug From: Rune Allnor Date: 8 Jan, 2012 10:25:12 Message: 2 of 4 |
|
On 8 Jan, 02:57, "Kate J." <kmj.w...@gmail.com> wrote: |
|
Subject: Reading from a file in c-mex s-function: odd bug From: Kate J. Date: 8 Jan, 2012 18:54:09 Message: 3 of 4 |
|
Thanks for your input, Rune. What I discovered was that my 2 arrays that were having trouble were being declared as double type, when they *needed* to be declared as floats. As soon as I made this change, the problem disappeared. |
|
Subject: Reading from a file in c-mex s-function: odd bug From: Rune Allnor Date: 8 Jan, 2012 19:05:39 Message: 4 of 4 |
|
On 8 Jan, 19:54, "Kate J." <kmj.w...@gmail.com> wrote: |
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.
Contact us at files@mathworks.com
