Re: return two different values
- To: mathgroup at smc.vnet.net
- Subject: [mg83858] Re: return two different values
- From: Szabolcs Horvát <szhorvat at gmail.com>
- Date: Mon, 3 Dec 2007 05:38:24 -0500 (EST)
- References: <fitscg$4ft$1@smc.vnet.net>
vicky Al Aisa wrote:
> Hello all
>
> I am writing a module, from which i want to return 2 different values,
> one table and one just a normal int
>
> i used this syntax in module
>
> Return[EMean,MeanImg];
>
> and while receiving it in main program i use
>
> {MeanX,RedMeanVec}=CalcMean[RedImg];
>
>
> is this correct, because i am getting some error..which mean that the
> arguments are not matching.
> so i tried to define those arguments , like i defined RedmeanVec as a
> table, but still it doesn work
> Error is below
>
>
> Break::nofunc
> Continue::nofunc
> Return::nofunc
> function::nofunc: Function f not found enclosing expr.
>
> I use Mathematica 5.2
>
> Thnaks
>
>
No, it's not correct. And you shouldn't use Return[] at all, except in
special situations. Just let the last expression in Module[] be a list:
Module[{}, something; {first, second}]
--
Szabolcs