Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Mathematica's function' topicStudent Support Forum > General > Archives > "Mathematica's function"

Next Comment >Help | Reply To Topic
Author Comment/Response
Avi
07/24/10 03:18am

Hi all.
I'm new to Mathematica and I'm wondering is there a way to wrap up a code segment. For examle, when i write a MatLab i can wrap a hole sequence. MatLab syntax:
function [rtn args] = MyFunction(inpt args)
//Do your code here.
In addition, it make sense to separate a function into a different file so your main procedure wont be messy.
As i'm googling my way around Mathematica i could only find examples for a single-line-logic function.
MyFunction:=[x_]
x^3+x^4

My main interest is DSP. Lets say i have my code snippet for impementing a digital filter. it takes i't arguments and returns the filter's coff.. the snipped is about 100 rows of code. I would like to wrap it and store it away from my main procedure so i can call execute it with a single line. Just like any other builtin function. To summerize, i'd like to solve two issues.
1. How do i create a multy-line function
2. How can i wrap a function to single file, and use it from my main nb.

Thank's


URL: ,

Subject (listing for 'Mathematica's function')
Author Date Posted
Mathematica's function Avi 07/24/10 03:18am
Re: Mathematica's function yehuda ben-s... 08/01/10 12:36pm
Next Comment >Help | Reply To Topic