a function that return two string's largest common part
% Usage: % [ret]=LCSubstr(s,t) % s: input string 1 % t: input string 2 % ret: Largest Common String % z: Largest Common String Length % L : Compare matrix % Example: % >>a='This is very common string'; % >>b='string is very common'; % >>[ret]=LCSubstr(a,b) % ret = % % very common
Python tuple unpacking works only for fixed length sequences, that is one cannot write something like: for (x,y,z=0,*rest) in [(1,2,3), (4,5), (6,7,8,9,10)]: print x,y,z,rest
This recipe returns a pad function that implements this...
AdvExpFigUI is a UI tool using AdvExpFig function that can export all the formats that the MATLAB's print function supports plus it can also create some additional formats (jpg,pdf implemented) by using the eps format as an intermediary format....
It's a simple function to print a progress bar under cli. When you call the function you have to indicate the max level that indicates 100% and what has been done considering the max level.
To be used as a decorator for a function that will maintain the number of times it was called. Here is an example use.
>>> def test(): ... print "Hello" ... >>> test =...
Slightly modified version of Coneplot function that uses the function quiver5 for better 3D arrows
This is a simple function that should come with the one present on this site (Variance Ratio Test) which couldn't work without this.
This is a function that evaluate all expressions and statements and return the result as a string. It also return Exceptions as strings. It is used in trypython.jcubic.pl
Do not use this function - instead use the built in type(name, bases, dict) constructor This is a function that builds a subclass of some base classes. I wrote it while unaware that type could be used as a constructor.
The createFunction(sourceCode) below returns a python function that executes the given sourceCode (a string containing python code). The function, being a real python function, doesn't incur any overhead compared to any normal python function. And...
This script contains a function that verifies if a string is a valid time, in the form hh:mm:ss am/pm, where seconds are optional. It accepts military time (hour between 0 and 23) as long as am/pm isn't specified.
It requires am/pm when...
This is a function that simulate the Alamouti Space-Time scheme and plot a BER vs SNR graph.
A function that codes a string of chars with Lempel Ziv coding
A robust function that uses frequency-domain -i/frequency filtering to integrate a function. Edge-tapering is used to minimize aliasing errors.
It is a matlab function that codes a string of char with Arithmetic coding.
res=arithmetic_code(alphabet, distr_pr, string)
'alphabet' is a vector that contains the char used in the string 'string'; 'string' is the string to...
A function that takes two sequences(vectors) as parameters and computes the circular convolution . x(n),h(n) are the vectors. The vectors need NOT be of equal lengths. If they are of unequal lengths, the shorter vector is appended...
SpinCalc is a consolidated matlab function that will convert any rotation data between the 4 types included. Will also convert between 2 different Euler angle set types.
Multiple orientations can be input. For N orientations: DCM...
Lagrange is a function that calculate equations of motion (Lagrange's equations) d/dt(dL/d(dq))- dL/dq=0. It Uses the Lagrangian that is a function that summarizes the dynamics of the system. Symbolic Math Toolbox is required.
It's a function that finds the minimum value of a two variables objective function with a deterministic zero order algorithm: simplex method.
The input variables are: -fun: inline function of the objective function
It is a Matlab function that determines the zero of a regular real function.
zero=newton_raphson(function,error)
The function has two input variable: 'function' is a string that represents the function of which find the... |