Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Calling function in one m-file from another m-file
Date: Thu, 18 Jun 2009 13:14:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 20
Message-ID: <h1deiq$rsn$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1245330842 28567 172.30.248.37 (18 Jun 2009 13:14:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 18 Jun 2009 13:14:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1133162
Xref: news.mathworks.com comp.soft-sys.matlab:548603


Hi,
I have two m-files. One is test.m and it contains this function:
function x = test

Another is target.m and it contains two functions:
function result = target(a)
function answer = start(b)

Both m-files are in one directory. Now I know that when I write in test.m
function x = test
given_result = target(param);

it will launch whatever is in fuction target(a) which is in target.m. But how can I call from m-file test.m function start(b) in target.m? Something like this

function x = test
given_answer= start(param);

but this will obviously not work.

Thanks.