MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: return two different values

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83896] Re: return two different values
  • From: dh <dh at metrohm.ch>
  • Date: Tue, 4 Dec 2007 04:17:25 -0500 (EST)
  • References: <fitscg$4ft$1@smc.vnet.net>


Hi Vicky,

a function always returns ONE value. If you want to return more, you 

have to enclose them in a list:

  Return[{EMean,MeanImg}]

hope this helps, Daniel



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

> 

> 




  • Prev by Date: Re: Hiding number cell
  • Next by Date: Re: different eigenvectors
  • Previous by thread: Re: return two different values
  • Next by thread: combine red green and blue channels