Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: ??? Reference to a cleared variable
Date: Mon, 5 Jul 2010 12:05:18 +0000 (UTC)
Organization: Boeing Co
Lines: 23
Message-ID: <i0shpu$358$1@fred.mathworks.com>
References: <i0scer$i3c$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1278331518 3240 172.30.248.37 (5 Jul 2010 12:05:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 5 Jul 2010 12:05:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: news.mathworks.com comp.soft-sys.matlab:650432

"CyberFrog" <domlee55@hotmail.com> wrote in message <i0scer$i3c$1@fred.mathworks.com>...
> Hi,
> 
> I have 2 moules of code whereby module_A feeds in certain inputs to module_B so each function id defined as:
> 
> function module_A   
> within this module the call to module_B is simply:
> module_B(input1, input2, input3)
> 
> function module_B(input1, input2, input3)
> 
> As you can see to feed in these inputs into a seconf module is easier enough but I do not know how to return these any new inputs generated by module_B into module_A???  Assume the call in A occurs half way down a load of code therefore I would like to feed in new inpust generated from B into A but to then continue down the second hald of code in A.  Obviously I cannot use this same call because it will start the code again when I just want it to continue.


If I understand you correctly, just do this:

function [input1 input2 input2] = module_B(input1, input2, input3)
    :
end

and then change the call to module_B accordingly.

James Tursa