octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #47628] addpath does not find data files for d


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #47628] addpath does not find data files for dlmread while matlab does
Date: Tue, 05 Apr 2016 20:18:15 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0

URL:
  <http://savannah.gnu.org/bugs/?47628>

                 Summary: addpath does not find data files for dlmread while
matlab does
                 Project: GNU Octave
            Submitted by: nrjank
            Submitted on: Tue 05 Apr 2016 08:18:14 PM GMT
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Nicholas Jankowski
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.1
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

Tested on Windows 7 with Octave 4.0.1, checked against Matlab 2015b

There seems to be inconsistency with what files can be accessed after the
folder has been added via addpath. Octave help says addpath adds a folder to
the function search path. Functions are thus found and executed as expected. 
However, other files, such as a csv data file, are found by some functions and
not others.

e.g., making a folder 'c:/temp/testdata', and adding a small csv text file
mytestdata.csv containing:

1,2,3,4
4,3,2,1


the following works locally as expected:

>> fopen('mytestdata.csv')
ans =  3

>> fclose all;

>> dlmread('mytestdata.csv',',')
ans =

   1   2   3   4
   4   5   3   2


But:

>> pwd
ans = c:\temp\testdata
>> addpath(pwd)

>> cd ..

>> fopen('mytestdata.csv')
warning: fopen: 'c:\temp\testdata\mytestdata.csv' found by searching load
path
ans =  3

>> fclose all;

>> dlmread('mytestdata.csv',',')
error: dlmread: unable to open file 'mytestdata.csv'


Checking in Matlab, the file opens just fine using dlmread.  There is also no
strict definition in the matlab help for addpath that the path is a 'function
only' path, and that it shouldn't be able to find data files. 

Seems there may be a case where Matlab m-code may expect to be able to create
a folder, addpath, put data files in there, and access them without a cd to
the folder, and that this could error out in Octave. Unclear as to whether
this is considered 'undocumented matlab' that we'd be trying to correct for.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47628>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]