Name

assert_expandvar — Expand variables so that they all have the same shape.

Calling Sequence

   ovar1 = assert_expandvar ( ivar1 )
   [ ovar1 , ovar2 ] = assert_expandvar ( ivar1 , ivar2 )
   [ ovar1 , ovar2 , ovar3 ] = assert_expandvar ( ivar1 , ivar2 , ivar3 )
   [ ovar1 , ovar2 , ovar3 , ovar4 ] = assert_expandvar ( ivar1 , ivar2 , ivar3 , ivar4 )
   
   

Parameters

ivar1 :

input variable #1

ovar1 :

output variable #1

Description

This function allows to expand input arguments of computationnal functions. If scalars are input, expand it to the size of other other variables.

If matrices are input, all must have the same shape: if not, an error is generated.

Examples

// Expand ovar1 to [1 1 1]
[ ovar1 , ovar2 ] = assert_expandvar ( 1 , [2 3 4] )

// Expand ovar2 to [4 4 4]
[ ovar1 , ovar2 ] = assert_expandvar ( [1 2 3] , 4 )

// Expand ovar2 to [4 4 4]'
[ ovar1 , ovar2 ] = assert_expandvar ( [1 2 3]' , 4 )

   

Authors

Michael Baudin - 2009-2010 - DIGITEO