# size of empty matrix Classic List Threaded 4 messages Open this post in threaded view
|

## size of empty matrix

 Could somebody explain it to my why I get different answers calling size(b) and "size b" when b is an empty matrix?octave:60> b=[]b = [](0x0)octave:61> size(b)ans =   0   0octave:62> size bans =   1   1Dmitri.--
Open this post in threaded view
|

## Re: size of empty matrix

 On Sat, Jun 16, 2018 at 8:07 PM, Dmitri A. Sergatskov wrote:Could somebody explain it to my why I get different answers calling size(b) and "size b" when b is an empty matrix?octave:60> b=[]b = [](0x0)octave:61> size(b)ans =   0   0octave:62> size bans =   1   1Dmitri.​Same with length(), any() ...​octave:71> b=[]b = [](0x0)octave:72> length bans =  1octave:73> length(b)ans = 0octave:74> any bans = 1octave:75> any(b)ans = 0Dmitri.--
 In reply to this post by Dmitri A. Sergatskov On Sat, Jun 16, 2018 at 20:07:46 -0500, Dmitri A. Sergatskov wrote: > Could somebody explain it to my why I get different answers calling > size(b) and "size b" when b is an empty matrix? Because "size b" is the same as "size ('b')", 'b' is a 1×1 char array. -- mike signature.asc (849 bytes) Download Attachment