[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Variable number of function return values
From: |
Gregor Beck |
Subject: |
Variable number of function return values |
Date: |
Fri, 2 Jun 2006 09:34:13 +0200 |
User-agent: |
KMail/1.8.2 |
Hi,
I try to get a variable number of return values from a function.
With matlab something like this does the trick:
C = cell(1, 4);
[C{:}] = fileparts('work/mytests/strArrays.mat')
C =
'work/mytests' 'strArrays' '.mat' ''
But with octave (2.9.5 & 2.1.44) I get
C =
{
[1,1] = work/mytests
[1,2] = work/mytests
[1,3] = work/mytests
[1,4] = work/mytests
}
Is this the intended behavior?
Is there another way to achieve this?
thanks,
Gregor
- Variable number of function return values,
Gregor Beck <=