Advanced Software Development - pbouffard/matlabtojulia GitHub Wiki

Mapping functions described in the MATLAB Advanced Software Development documentation to Julia equivalents.

Creating Classes

Class Syntax Guide

Sample Class Implementations

Class Definition

Class File Organization

  • classdef Class definition keywords
  • import Add package or class to current import list

Properties

  • properties Class property names
  • isprop Determine if property of object
  • mustBeFinite Validate that value is finite or issue error
  • mustBeGreaterThan Validate that value is greater than another value or issue error
  • mustBeGreaterThanOrEqual Validate that value is greater than or equal to another value or issue error
  • mustBeInteger Validate that value is integer or issue error
  • mustBeLessThan Validate that value is less than another value or issue error
  • mustBeLessThanOrEqual Validate that value is less than or equal to another value or issue error
  • mustBeMember Validate that value is member of specified set
  • mustBeNegative Validate that value is negative or issue error
  • mustBeNonempty Validate that value is nonempty or issue error
  • mustBeNonNan Validate that value is nonNaN
  • mustBeNonnegative Validate that value is nonnegative or issue error
  • mustBeNonpositive Validate that value is nonpositive or issue error
  • mustBeNonsparse Validate that value is nonsparse or issue error
  • mustBeNonzero Validate that value is nonzero or issue error
  • mustBeNumeric Validate that value is numeric or issue error
  • mustBeNumericOrLogical Validate that value is numeric or logical or issue error
  • mustBePositive Validate that value is positive or issue error
  • mustBeReal Validate that value is real or issue error
  • dynamicprops Superclass for classes that support dynamic properties meta.* DynamicProperty Describe dynamic property of MATLAB object event.* DynamicPropertyEvent Event data for dynamic property events meta.* property Describe property of MATLAB class meta.* Validation Describes property validation meta.* FixedDimension Fixed dimension in property size specification meta.* UnrestrictedDimension Unrestricted dimension in property size specification meta.* ArrayDimension Size information for property validation matlab.lang.* OnOffSwitchState Represent on and off states with logical values Methods
  • methods Class method names
  • ismethod Determine if method of object meta.* method Describe method of MATLAB class Handle Classes
  • isequal Determine array equality
  • eq Determine equality
  • handle Superclass of all handle classes matlab.mixin.* SetGet Provide handle classes with set and get methods matlab.mixin.* SetGetExactNames Require exact name match for set and get methods
  • dynamicprops Superclass for classes that support dynamic properties matlab.mixin.* Copyable Superclass providing copy functionality for handle objects Events
  • events Event names handle.* notify Notify listeners that event is occurring handle.* addlistener Create event listener bound to event source handle.* listener Create event listener without binding to event source event.* hasListener Determine if listeners exist for event event.* EventData Base class for event data event.* listener Class defining listener objects event.* PropertyEvent Data for property events event.* proplistener Define listener object for property events Class Hierarchies Subclass Definition
  • superclasses Names of superclasses matlab.mixin.* Heterogeneous Superclass for heterogeneous array formation Enumerations
  • enumeration Class enumeration members and names
  • isenum Determine if variable is enumeration meta.* EnumeratedValue Describe enumeration member of MATLAB class Class Customization Object Indexing
  • numArgumentsFromSubscript Number of arguments for customized indexing methods
  • subsref Redefine subscripted reference for objects
  • subsasgn Redefine subscripted assignment
  • subsindex Convert object to array index
  • substruct Create structure argument for subsasgn or subsref
  • builtin Execute built-in function from overloaded method Object Arrays
  • empty Create empty array matlab.mixin.* Heterogeneous Superclass for heterogeneous array formation Customize Object Display for Classes
  • display Used internally for command-window display
  • details Display array details matlab.mixin.* CustomDisplay Interface for customizing object display matlab.mixin.util.* PropertyGroup Custom property list for object display Object Save and Load
  • saveobj Modify save process for object
  • loadobj Customize load process for objects Class Editing
  • edit Edit or create file Class Introspection and Metadata
  • metaclass Obtain meta.class object meta.* abstractDetails Find abstract methods and properties meta.class.* fromName Return meta.class object associated with named class meta.package.* fromName Return meta.package object for specified package meta.package.* getAllPackages Get all top-level packages
  • properties Class property names
  • methods Class method names
  • events Event names
  • superclasses Names of superclasses meta.* class Describe MATLAB class meta.* property Describe property of MATLAB class meta.* method Describe method of MATLAB class meta.* event Describe event of MATLAB class meta.* package Describe MATLAB package meta.* DynamicProperty Describe dynamic property of MATLAB object meta.* EnumeratedValue Describe enumeration member of MATLAB class meta.* MetaData Superclass for MATLAB object metadata meta.* ArrayDimension Size information for property validation meta.* Validation Describes property validation meta.* FixedDimension Fixed dimension in property size specification meta.* UnrestrictedDimension Unrestricted dimension in property size specification System Objects Use System Objects
  • step Run System object algorithm
  • clone Create duplicate System object
  • isLocked Determine if System object is in use
  • nargin Number of input arguments for System object
  • nargout Number of output arguments for System object
  • reset Reset internal states of System object
  • release Release resources and allow changes to System object property values and input characteristics Create System Objects matlab.* System Base class for System objects matlab.system.* StringSet Set of valid character vector values matlab.system.mixin.* FiniteSource Finite source mixin class

Toolbox Distribution

The rough equivalent of a MATLAB toolbox in Julia is a package.

Performance and Memory

  • timeit Measure time required to run function
  • tic Start stopwatch timer
  • toc Read elapsed time from stopwatch
  • cputime Elapsed CPU time
  • profile Profile execution time for functions
  • bench MATLAB benchmark
  • memory Display memory information
  • inmem Names of functions, MEX-files, classes in memory
  • pack Consolidate workspace memory
  • memoize Add memoization semantics to function handle
  • MemoizedFunction Call memoized function and cache results
  • clearAllMemoizedCaches Clear caches for all MemoizedFunction objects

System Commands