matlap

Discussion in 'Programmer's Corner' started by TAKYMOUNIR, Jun 8, 2013.

  1. TAKYMOUNIR

    Thread Starter Active Member

    Jun 23, 2008
    351
    1
    what is the different between
    z=zeros(size(1,100))
    and
    z=zeros(size(100))
    and
    z=zeros(size(100,1))
    i run these codes but i do not see the different
    so can someone explain the different
    thanks
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,429
    3,360
    Start off with the lowest level function. Ignore the zeros( ) function and size( ) function for now.

    type 10,12 or 1,23

    the result is 12 and 23

    size( ) will return the size of the object.

    size(100) is simply 1.

    type in 100,1 or 1,100
    the result is a scalar

    hence size(scalar) is 1

    zeros(1) is 0
     
    Last edited: Jun 8, 2013
    TAKYMOUNIR likes this.
Loading...