| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
b = loadobj(a)
b = loadobj(a) is called by the load function if the class of a defines a loadobj method. load returns b as the value loaded from a MAT-file.
Define a loadobj method when objects of the class require special processing when loaded from MAT-files. If you define a saveobj method, then define a loadobj method to restore the object to the desired state. Define loadobj as a static method so it can accept as an argument whatever object or structure that you saved in the MAT-file. See Implement loadobj as a Static Method.
When loading a subclass object, load calls only the subclass loadobj method. If a superclass defines a loadobj method, the subclass inherits this method. However, it is possible that the inherited method does not perform the necessary operations to load the subclass object. Consider overriding superclass loadobj methods.
If any superclass in a class hierarchy defines a loadobj method, then the subclass loadobj method must ensure that the subclass and superclass objects load properly. Ensure proper loading by calling the superclass loadobj (or other methods) from the subclass loadobj method. See Saving and Loading Objects from Class Hierarchies.
a |
The input argument, a, can be: |
![]() | loadlibrary | log | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |