Gauss & Equivalent Matlab Code Fragments

The following list (in no particular order), gives examples of Matlab equivalent syntax and function names, relative to Gauss.

Gauss Syntax Matlab Syntax
/* comments */

proc(nargs)=fnname(inp1,inp2,..inpn);

local var1,var2,..varn;

retp(ret1,ret2);

endp;

#include incfname.dec;

x[1]

x~y

x|y

maxc((f(x)|g(x))

(x|y)~(z|w)

sumc( ) , prodc( ), meanc( ), stdc( ), minc( ), maxc( ), cumsumc( ), cumprodc( )

sortc( )

rndu( )

cdfn(__ ) , pdfn(__ )

title("string here") , xlabel(" ")

ylabel(" ") , zlabel(" ")

xy(x,f(x)), xyz(x,y,f(x,y)), surface(x,y,z)

endif, endo, do while, and, or, !=

f(&fnname,...)

_globvname

{ ... } =

string1 $+ string2

string1 $== string2

"string1"|"string2"

" expression "

.<, .>, .==, .le, .ge, !=

% comments

function [ret1,ret2]=fnname(inp1,.,inpn)

not needed

not needed

not needed

global m-files can be created

x(1)

[x y]

[x;y]

max( [f(x) ; g(x)])

[ [x;y] [z;w]]

sum( ) ,prod( ) ,mean( ) ,std( ) ,min( ) , max(), cumsum(), cumprod()

sortrows( )

rand( )

normcdf(__,0,1), normpdf(__,0,1)

title('string here'),xtitle(' ')

ytitle(' ') , ztitle(' ')

plot(x,f(x)), plot3(x,y,f(x,y)), surf(x,y,z)

end, end, while, &, | , ~=

f('fnnam',....)

GLOBVNAME

[ ... ] =

strcat(string1,string2)

strcomp(string1,string2)

strvcat(string1,string2)

'expression'

< , > , ==, <= , >= , ~=

[Main Gauss to Matlab Page| Cameron Rookley's Home Page| Gauss Archive of Mainly Finance Code]

Revised -- 1/1/2003