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$>
References: <i0scer$i3c$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1278331518 3240 (5 Jul 2010 12:05:18 GMT)
NNTP-Posting-Date: Mon, 5 Jul 2010 12:05:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: comp.soft-sys.matlab:650432

"CyberFrog" <> wrote in message <i0scer$i3c$>...
> 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)

and then change the call to module_B accordingly.

James Tursa