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

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

[Octave-bug-tracker] [bug #54736] Behavior of load() when a specified na


From: Guillaume
Subject: [Octave-bug-tracker] [bug #54736] Behavior of load() when a specified name keyword is missing
Date: Wed, 26 Sep 2018 12:41:27 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

URL:
  <https://savannah.gnu.org/bugs/?54736>

                 Summary: Behavior of load() when a specified name keyword is
missing
                 Project: GNU Octave
            Submitted by: gyom
            Submitted on: Wed 26 Sep 2018 04:41:25 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Guillaume
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

When trying to load a named variable of a mat-file, if it is not present,
Octave returns an error while  Matlab displays a warning and returns an empty
structure.

Octave:


octave> A = pi;
octave> save('A.mat','A');
octave> x = load('A.mat','A')
x =
  scalar structure containing the fields:
    A =  3.1416
octave> x = load('A.mat','B')
error: load: empty name keyword or no data found in file 'A.mat'
octave> x = load('A.mat','A','B')
x =
  scalar structure containing the fields:
    A =  3.1416


Matlab:


>> A = pi;
>> save('A.mat','A');
>> x = load('A.mat','A')
x = 
  struct with fields:
    A: 3.141592653589793
>> x = load('A.mat','B')
Warning: Variable 'B' not found. 
x = 
  struct with no fields.
>> x = load('A.mat','A','B')
Warning: Variable 'B' not found. 
x = 
  struct with fields:
    A: 3.141592653589793






    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?54736>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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