From: us on
"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
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
us,

Thanks you! I forgot that I could achieve the same behavior by using structs...
From: Greg Heath on
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
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.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: bode plot
Next: Continuous data stream from dos executable