From: us on 12 Jun 2010 09:09 "Hugo " <hresquiveloa(a)gmail.com> wrote in message <huv0if$a62$1(a)fred.mathworks.com>... > Sorry! This was not what I wanted to ask... my apologies... > > My question is: if I can initialize a variable, say var, so I can get nothing when I type it in the prompt: > % var > % > > (I mean without answer)... as the same way one can get with varargin when its list is empty. > > Many thanks in advance. this anomaly can be produce by this syntax... s=struct('a',{},'b',[]); s.a s.b % nothing's displayed in the command window in both cases... us
From: Hugo on 12 Jun 2010 13:52 Matt, Thank you very much for your help... it will work just as you described... I just wanted to know how to emulate its behavior.
From: Hugo on 12 Jun 2010 13:55 us, Thanks you! I forgot that I could achieve the same behavior by using structs...
From: Greg Heath on 12 Jun 2010 17:47 On Jun 12, 1:55 pm, "Hugo " <hresquive...(a)gmail.com> wrote: > us, > > Thanks you! I forgot that I could achieve the same behavior by using structs... Next time use a dummy name that is not a MATLAB function. help var Hope this helps. Greg
From: Doug Schwarz on 12 Jun 2010 21:57
In article <hv00tg$a1f$1(a)fred.mathworks.com>, "us " <us(a)neurol.unizh.ch> wrote: > "Hugo " <hresquiveloa(a)gmail.com> wrote in message > <huv0if$a62$1(a)fred.mathworks.com>... > > Sorry! This was not what I wanted to ask... my apologies... > > > > My question is: if I can initialize a variable, say var, so I can get > > nothing when I type it in the prompt: > > % var > > % > > > > (I mean without answer)... as the same way one can get with varargin when > > its list is empty. > > > > Many thanks in advance. > > this anomaly can be produce by this syntax... > > s=struct('a',{},'b',[]); > s.a > s.b > % nothing's displayed in the command window in both cases... > > us That's one way. The other is c = {}; c{:} -- Doug Schwarz dmschwarz&ieee,org Make obvious changes to get real email address. |