Grocer Function

NAME

com_size - replaces values of matrix x

CALLING SEQUENCE

[ret,x,aout,bout]=com_size(x,a,b)

PARAMETERS

Input

Output

DESCRIPTION

Makes a,b scalars equal to constant matrices size(x) or leave them unchanged if they are already of common size

EXAMPLE

1) [r,x,ao,bo]=com_size(ones(4,3),5,2)
2) [r,x,ao,bo]=com_size(ones(2,2),[3,2;1,0],[2,4;5,3])
3) [r,x,ao,bo]=com_size(ones(2,2),[3,2],[2,4;5,3])

Example 1 returns:
bo  =
!   2.    2.    2. !
!   2.    2.    2. !
!   2.    2.    2. !
!   2.    2.    2. !
 ao  =
!   5.    5.    5. !
!   5.    5.    5. !
!   5.    5.    5. !
!   5.    5.    5. !
 x  =
!   1.    1.    1. !
!   1.    1.    1. !
!   1.    1.    1. !
!   1.    1.    1. !
 r  =
    0.               
Example 2 returns:
bo  =
!   2.    2.    2. !
!   2.    2.    2. !
!   2.    2.    2. !
!   2.    2.    2. !
 ao  =
!   5.    5.    5. !
!   5.    5.    5. !
!   5.    5.    5. !
!   5.    5.    5. !
 x  =
!   1.    1.    1. !
!   1.    1.    1. !
!   1.    1.    1. !
!   1.    1.    1. !
 r  =
    0.               
Example 3 returns:
bo  =
!   2.    4. !
!   5.    3. !
 ao  =
!   3.    2. !
 x  =
!   1.    1. !
!   1.    1. !
 r  =
    1.
             

AUTHOR

Eric Dubois 2002