[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: varargout{:} = func() ?
From: |
Ben Abbott |
Subject: |
Re: varargout{:} = func() ? |
Date: |
Wed, 24 Feb 2010 10:29:33 -0500 |
On Wednesday, February 24, 2010, at 09:59AM, "forkandwait" <address@hidden>
wrote:
>> v = cell (expected_outputs, 1);
>> [v{:}] = func (...);
>>
>> should work in any recent version of Octave.
>
>It does.
>
>> clear v;
>> [v{:}] = func (...);
>
>Hmm. But they said it would on the newsgroup ;). To be fair, they may have
>assumed that one would know pre-sizing the cell array.
>
>> will not work, because Octave can't determine nargout for the function
>> call. I expect this is also true in Matlab.
>
>I guess there is no notation in case one doesn't know the number of expected
>outputs? I am just curious at this point.
>
I'm not sure I understand what you're hoping to do. Something like what I
illustrate below (which doesn't work).
function [a, b, c] = foobar ()
a = 1;
b = 2;
c = 3;
end
v{:} = foobar ()
v = [1] [2] [3]
Ben
- Re: varargout{:} = func() ?, (continued)
- Re: varargout{:} = func() ?, Jaroslav Hajek, 2010/02/23
- Re: varargout{:} = func() ?, forkandwait, 2010/02/24
- Re: varargout{:} = func() ?, John W. Eaton, 2010/02/24
- Re: varargout{:} = func() ?, forkandwait, 2010/02/24
- Re: varargout{:} = func() ?, John W. Eaton, 2010/02/24
- Re: varargout{:} = func() ?, forkandwait, 2010/02/24
- Re: varargout{:} = func() ?, Jaroslav Hajek, 2010/02/24
Re: varargout{:} = func() ?, Ben Abbott, 2010/02/24
Re: varargout{:} = func() ?,
Ben Abbott <=