Included functions for MathPad I love MathPad, because itÕs simple to use, it needs small memory, and itÕs possible to have in the same document a lot of comments, calculations and results. New version 2.5.2 brings enhancements such as copy plot at 288 dpi and possibilities to control curves colors and makers (and othersÉ). For these reasons, itÕs very easy for a teacher (for example) to make a correct (of an exercise, an exam) with MathPad. One problem with MathPad is that itÕs very basic, and when one wants to manipulate arrays, syntax becomes very quickly heavy and unreadable. One big advantage of Mathpad is itÕs open concept : we can buit files of additionnal functions and call them at the begening of one calculation file by the keyword ÇinclÈ. IÕm a big user of MathPad, and I made such functions in order to simplify my task. As MathPad is free (one other big advantage), I thought it should be a good thing that my work serves to other MathPad users. So, you shall find in this folder two included functions files, ÇbasicÈ, relative to basic array building and manipulating, and ÇwaveÈ, which can be useful for people who have to manipulate (virtually) various electric signals. You can put them in the ÇinclÈ folder of MathPad and call them as you want. ******* functions available ********** __________________________________________________________________ In the file ÇbasicÈ, there are following functions : linspace : creates vectors of linearly spaced values logspace : creates vectors of logarithmically spaced values concath : concatenates horizontally two arrays or vectors concatv : concatenates vertically two arrays or vectors interplin : interpolates values from a couple of vectors deriv : derivates one vector versus one other sort : sorts an array size : gives the dimensions of an array length : gives the bigger dimension of an array rem : gives the remainder of two numbers mod : gives the modulus of two numbers sgn : gives the sign of a number int : gives integer part of a number frac : gives the fractionnal part of a number stair : creates an array for direct staircase plot with plotline command bar : creates an array for direct bargraph plot with plotline command __________________________________________________________________ In the file ÇwaveÈ, there are following functions : hvsd : creates a stair heaviside signal hvsd_tun : creates a tunable stair heaviside signal sqr_pls : creates a square pulse signal sqr_pls_tun : creates a tunable square pulse signal dirac : creates a dirac signal sinus : creates a sinus wave square : creates a square wave sawtooth : creates a sawtooth wave slope : creates a continuous slope signal noise : creates a random noise signal noise_wh : creates a white noise signal add : adds the values of two signals inv : inverts the polarity of the signal mult : multiply the values of two signals join : concatenates two signals att : attenuates or amplify a signal lopass1 : first order low pass filter lopass2 : second order low pass filter hipass1 : first order high pass filter hipass2 : second order high pass filter __________________________________________________________________ ******** Examples of use *********** These function files are given with two example files ÇExample basicÈ and ÇExample wave 1È and ÇExample wave 2È The function files include comments and syntax : refer to them to understand how run all these functions. ******* Problems ******* As included files are opened and evaluated simultaneously with your own calculation file, there may have some interferences with global variables such as subscript or other. In order to avoid that, I wrote all functions with special names for internally used global variables : subs_xx, cnt_xx, flg_xx, glob_xx, where xx is a number between 01 and 99. So, the two function files (and I hope others in the futureÊ!) can be opened simultaneously without any interference, and if you avoid these names in your calculation files, you will have no problem. ******* Contact ******* For comments, bug report, suggestions, please contact me by email : chevallier.dominique@free.fr Dominique Chevallier, Toulouse, France