Path: news.mathworks.com!not-for-mail
From: "Isabel" <isabels29@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: getting a list
Date: Sun, 30 Nov 2008 19:34:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <ggupr9$280$1@fred.mathworks.com>
Reply-To: "Isabel" <isabels29@hotmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228073642 2304 172.30.248.38 (30 Nov 2008 19:34:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 30 Nov 2008 19:34:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1534283
Xref: news.mathworks.com comp.soft-sys.matlab:503960


How can I get matlab to give me a list as the answer to a function? For example
function [a,b]=add(T)
a=2*T
b=3*T
[2*T,3*T]
everytime I do something like that, it only gives me back the first element. So in this case it would give me as an answer only 2*T.
What I've been doing is this:
function z=add(T)
z(1)=2*T
z(2)=3*T
end
but I would like to know how to put a list as an output argument. Thanks!