[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Can't read file with fopen and fscanf fails
From: |
Ricardo Carvalho |
Subject: |
Can't read file with fopen and fscanf fails |
Date: |
Fri, 9 Apr 2004 20:33:25 +0100 |
I installed GNU OCTAVE 2.1.50 for Windows and created the directory 'D:\GNU
Octave 2.1.50\opt\octave\share\octave\2.1.50\m\harmgen\'. Then I copied 2
files to that directory: 'harmgen.m' and 'oct_input.txt' (text file with
numbers). At the OCTAVE prompt I wrote harmgen (script presence is
recognised, no path problems) and the first line of the script was executed
but the second failed (error is 'inf= - 1'). The script file I created has
no headers (are they necessary?) and is like this:
silent_functions = 1
inf = fopen ("oct_input.txt", "r");
Nc = fscanf (inf, "%u", 1)
etc, etc, etc....
I then uninstalled OCTAVE for Windows and reinstalled but file presence is
still not recognised/located. In a previous instalation I was able to read
the file into memory - don't ask me why/how - but, even then, the following
instruction (Nc=fscanf...) failed.
Please help. Thanks, Ricardo Carvalho (Lisbon, Portugal)
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- Can't read file with fopen and fscanf fails,
Ricardo Carvalho <=