New to Mathematica- How to write functions????????
- To: mathgroup at smc.vnet.net
- Subject: [mg58876] New to Mathematica- How to write functions????????
- From: "Someonekicked" <someonekicked at comcast.net>
- Date: Thu, 21 Jul 2005 15:46:06 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
new to mathematica, looked at the help, but did not get the help i needed.. I want to write a function that does multiple calculations in its body, then it returns a value. I am talking about functions similar to functions that you can declare in C++. can anyone give me an example? in C++, a function would be like, (note int means integer) int zzz(int s, int y) { int Q; Q = s*y; return Q; } well thats just a simple example, the body of my function is going to be complicated... I know in mathematica, I can solve the same zzz by zzz[s_,y_] := s*y; However, what if i want the body more complicated and do more than one thing??
- Follow-Ups:
- Re: New to Mathematica- How to write functions????????
- From: "Yasvir A. Tesiram" <tesiramy@omrf.ouhsc.edu>
- Re: New to Mathematica- How to write functions????????
- From: Zhengji Li <zhengji.li@gmail.com>
- Re: New to Mathematica- How to write functions????????
- From: Sseziwa Mukasa <mukasa@jeol.com>
- Re: New to Mathematica- How to write functions????????