÷ƒ’À;è TeX output 2001.03.14:1645‹ÿÿÿÿ Û_2 ý ~? ÕÁ ýZݺóþÖëI½q½qecss2074»T‘þfKela–fÑHelp“Fileޤ ®„ØcÕÁGŽŽ¡ó 1ê± ecrm1000¹P•¸èekk‘ÿqÐa›U Janh“unen,˜óqLË ectt1000¼Pekka.Janhunen@fmi.fi’ÂË[¹v1.0,˜2˜August˜1994Ž¡Ÿ&°óŒ6 ecss1000½T–ÿ*¸ela›jË("T“enso¸èr˜Language")˜is˜a˜numerical˜computing˜environment.‘ ²This˜is˜the˜basic˜T“ela˜help˜le.‘ ²It˜isŽ¡read–JEonline“b¸èy“the“T›ÿ*¸ela“help“function.‘ PðY˜ou“can“also“foš¸èrmat“and“p˜rint“it“as“a“whole“using“the“LinuxdoGc-Ž¡SGML‘ûu'fo¸èrmat'–ügcommand.‘gTSee“also:‘ À óø8‹ ecsi1000¾telafuncs.html“¼½,‘æ8¾telafuncsSectioned.htmlŽ¡¼½.‘ C†¾Graphics–EÍexamples“¼–…ø½and“¾FMI/GEO‘…ìhome“page“¼“½a¸ère“also“available.‘ Send“T‘ÿ*¸ela“bugŽ¡repGo¸èrts–U to“¼tela-bugs@fmi.fi½.‘q€Send“suggestions“to“¼tela-suggestions@fmi.fi½.ޤ(Àœó&Lt$ffffecbx1440ÀCon•cten“tsŽ¡1Ž‘ÁInctropœductionŽŸ¿:¹T–ÿ*¸ela›U ("T“ensor˜Language")˜is˜a˜n•¸èumerical˜computing˜en“vironmen“t.‘q€A˜summary˜of˜its˜basic˜features˜follo“ws:ŽŸؼ‘)ý`¼-–?¬The“syntax“reminds“C,“coming“sometimes“close“to“Pascalޤ ®‘)ý`-–?¬Some“features“have“been“borrowed“from“Matlab“and“other“languagesŽ¡‘)ý`-–?¬Tela“supports“N-dimensional“arrays“(currently,“N“must“be“less“than“5)Ž¡‘)ý`-–?¬Arrays“can“be“indexed“and“manipulated“as“in“Matlab“and“Fortran-90Ž¡‘)ý`-–?¬Six“basic“numerical“data“types:“integer,“real“and“complex“arraysŽ¡‘4|¸and‘?¬scalarsŽ¡‘)ý`-–?¬Fast.“Also“scalar“loops“are“pretty“fast.Ž¡‘)ý`-–?¬Graphics“is“currently“handled“using“Kenny“Toh's“PlotMTV“programŽ¡‘)ý`-–?¬Uses“HDF“files“as“native“data“formatŽ¡‘)ý`-–?¬Besides“in“Tela“itself,“you“can“also“write“new“functions“using“C-Tela,Ž¡‘4|¸which–?¬is“modified“C++.“Large“parts“of“Tela“has“been“written“in“C-Tela.ŽŸ(ÀœÀ2Ž‘ÁFlošcw–G\of“con˜trol“statemen˜tsŽŸèó¥!¢N ecbx1200Â2.1Ž‘¾if,‘¸elseŽŸMª¹Reserv•¸èed›U w“ords:‘q€if,˜elseŽŸؼThe–U if“statemenš¸èt“syn˜tax:ޤ´å‘+å:óqLË ectt0900Äif–¹N(expr)“stmtŽ©ؼ¹orŽ¡‘+å:Äif–¹N(expr)“stmt“else“stmtަ¹The–*†expression“mš¸èust“ev‘ÿqÐaluate“to“in˜teger“scalar“or“arra˜y‘ÿ*¸.‘ñ±The“condition“is“considered“true“if“the“scalar“isŽŸ ®nonzero–U or“if“all“the“arraš¸èy“elemen˜ts“are“nonzero.‘q€Examples:ŽŸ´å‘+å:Äif‘¹N(x!=0)ŽŽŽŒ‹* Û_2 ý ~?Ÿ„€ÕÁGŽó]fŒ ecbx1000Å2.‘ñ8Floš®>w–Õof“con˜trol“statemen˜ts’8ò¹2ŽŽ ÕÁ ýV¯‘>ÊrÄformat("x–¹Nis“nonzero,“x=``\n",x)‘å8//“notice“no“semicolonޤ Š=‘+å:else‘¹N{Ž¡‘>Êrx–¹N=“1;Ž¡‘>Êrformat("x–¹Nwas“zero“and“is“now“1\n");//“this“semicolon“is“optionalŽ¡‘+å:};‘ rœ//–¹Nthis“semicolon“separates“this“if“stmt“from“the“next“stmt,“if“anyŽŸ#ÃÂ2.2Ž‘¾forŽŸMª¹Reserv•¸èed‘U w“ord:‘q€forŽŸؼThe–U for“statemenš¸èt“syn˜tax:ޤ´å‘+å:Äfor–¹N(init-stmt;“continue-condition-expr;“update-stmt)“stmtŽ©ؼ¹F‘ÿ*¸or‘U example:Ž¡‘+å:Äfor–¹N(i=1;“i<=imax;“i++)“a[i]“=“0.5*i;ަ¹The–g,for“statemenš¸èt“is“similar“to“that“found“in“C‘g(language.‘§¥The“only“exception“is“that“in“T‘ÿ*¸ela“the“'init-stm˜t'ޤ ®and–øá'upGdate-stmš¸èt'“are“statemen˜ts,‘!Òwhereas“in“C‘ø·they“are“expressions.‘\ÄThis“is“bGecause“the“assignmen˜t“'='Ž¡is–³ža“statemen¸èt“in“T‘ÿ*¸ela,‘Ë=not“an“opšGerator“as“in“C.“There“is“no“comma“op˜erator“in“T‘ÿ*¸ela.‘ŒùIf“yš¸èou“w˜an˜t“to“ha˜v˜eŽ¡sev•¸èeral›U statemen“ts˜as˜y“our˜init˜or˜upGdate˜statemen“t,˜y“ou˜ha“v“e˜to˜use˜braces,˜for˜example:ޤ´å‘+å:Äfor–¹N({i=1;“j=10};“i<=10;“{i++;j--})“format("i=``,“j=``\n",i,j);ަ¹When–U expr“is“considered“true,“see“2.1“(if‘Ç).ŽŸ#ÃÂ2.3Ž‘¾foreac hŽŸMª¹Reserv•¸èed‘U w“ord:‘q€foreac“hŽŸؼThe–U foreacš¸èh“statemen˜t“syn˜tax:Ž¡‘+å:Äforeach–¹N(i=A)“stmt;ަ¹will–U lošGop“o•¸èv“er–U all“comp˜onenš¸èts“of“arra˜y“A,“setting“i“equal“to“the“compGonen˜t“on“eac˜h“iteration.Ž©ؼW‘þã ARNING:–M•This“statemenš¸èt“is“curren˜tly“included“only“for“easing“transition“from“Matlab.‘¨The“implemen˜tationޤ ®is–™not“optimal.‘.þIn“the“future“the“statemenš¸èt“ma˜y“ev˜en“disappGear.‘.þThe“Matlab“to“T‘ÿ*¸ela“translator“m2t“generatesŽ¡foreac•¸èh›U statemen“ts,˜whic“h˜y“ou˜should˜translate˜to˜ordinary˜for˜statemen“ts˜soGoner˜or˜later.ަSee–U also:‘q€2.2“(for)ŽŸ#ÃÂ2.4Ž‘¾rep_úeat,‘¸un tilŽŸMª¹Reserv•¸èed›U w“ords:‘q€repGeat,˜un“tilަThe–U repGeat..unš¸ètil“statemen˜t“syn˜tax:ŽŸ´å‘+å:Ärepeat–¹Nstmt-sequence“until“exprŽŸؼ¹F‘ÿ*¸or‘U example:ŽŽŽŒ‹ ® Û_2 ý ~?Ÿ„€ÕÁGŽÅ2.‘ñ8Floš®>w–Õof“con˜trol“statemen˜ts’8ò¹3ŽŽ ÕÁ ýV¯‘+å:Äi–¹N=“1;ޤ Š=‘+å:repeatŽ¡‘>Êrformat("i–¹N=“``\n",i);Ž¡‘>Êri++Ž¡‘+å:until–¹Ni“>“10;Ž©ؼ¹This–&;is“exactly“similar“to“P¸èascal,›/œincluding“the“use“of“semicolons.‘aßWhen“expr“is“considered“true,˜see“2.1“(if‘Ç).ޤؼSee–U also:‘q€2.5“(while),“2.1“(if‘Ç)ŽŸ#ÃÂ2.5Ž‘¾whileŽŸMª¹Reserv•¸èed‘U w“ord:‘q€whileŽ¡The–U while“statemenš¸èt“syn˜tax:ޤ´å‘+å:Äwhile–¹N(expr)“stmtަ¹F‘ÿ*¸or‘U example:Ž¡‘+å:Äwhile–¹N(!found)“{ޤ Š=‘>ÊrLookForIt();Ž¡‘>Êrcounter++Ž¡‘+å:};ަ¹The–U statemenš¸èt“is“executed“un˜til“expr“ev‘ÿqÐaluates“to“false.‘q€When“expr“is“considered“false“or“true,“see“2.1“(if‘Ç).ޤؼSee–U also:‘q€2.4“(repGeat)ŽŸ#ÃÂ2.6Ž‘¾returnŽŸMª¹Reserv•¸èed‘U w“ord:‘q€returnŽ¡The–€¿return“statemenš¸èt“returns“from“the“curren˜t“function.‘ô\An˜y“output“v‘ÿqÐariables“m˜ust“bšGe“assigned“b˜eforeŽŸ ®calling–U return,“or“they“will“remain“undened.Ž¡If–U called“from“the“main“lev¸èel“of“a“source'd“le“or“command“line,“stops“execution“of“the“source'd“le.ŽŸ´å‘+å:Äfunction–¹Nresult=AllPositive(A)“{ޤ Š=‘>Êrfor–¹N(i=1;“i<=length(A);“i++)Ž¡’Š_Rif–¹N(A[i]<=0)“{Ž¡’°)Âresult–¹N=“0;Ž¡’°)ÂreturnŽ¡’Š_R};Ž¡‘d”âresult–¹N=“1;Ž¡‘+å:};ަ¹The–U function“returns“1“if“all“elemenš¸èts“of“v˜ector“A“are“pGositiv˜e,“and“zero“otherwise.ŽŸؼSee–U also:‘q€3.2“(function),“2.7“(break)ŽŽŽŒ‹ Û_2 ý ~?Ÿ„€ÕÁGŽÅ2.‘ñ8Floš®>w–Õof“con˜trol“statemen˜ts’8ò¹4ŽŽ ÕÁ ýV¯Â2.7Ž‘¾break,‘¸con• tin“ueŽŸMª¹Reserv•¸èed›U w“ords:‘q€break,˜con“tin“ueޤؼThe–Xobreak“statemenš¸èt“exits“the“surrounding“loGop.‘{mIt“is“analogous“to“the“break“statemen˜t“of“C.“The“loGop“canŽ© ®bšGe–U a“for-lo˜op,“a“while-lo˜op“or“a“rep˜eat-“un¸ètil“lo˜op.Ž¡The›‡“con•¸ètin“ue-statemen“t˜eectiv“ely˜jumps˜to˜the˜end˜of˜the˜b•Go“dy˜of˜the˜surrounding˜lo“op,‘”/causing˜the˜nextަiteration–U to“bGegin.‘q€It“is“analogous“to“the“con•¸ètin“ue›U statemen“t˜of˜C.Ž¡F‘ÿ*¸or‘U example,Ž©´å‘+å:Äfor–¹N(i=1;“i<=10;“i++)“{ޤ Š=‘>Êrif–¹N(i==5)“break;Ž¡‘>Êrdisp‘¹NiŽ¡‘+å:};ŽŸؼ¹outputs–U the“n•¸èum“bGers–U 1,2,3“and“4.‘q€On“the“other“hand,ަ‘+å:Äfor–¹N(i=1;“i<=10;“i++)“{Ž¡‘>Êrif–¹N(i==5)“continue;Ž¡‘>Êrdisp‘¹NiŽ¡‘+å:};ŽŸؼ¹outputs–U the“n•¸èum“bGers–U from“one“to“ten,“excluding“v¸èe.ޤؼSee–U also:‘q€2.6“(return),“2.8“(goto).ŽŸ#ÃÂ2.8Ž‘¾goto,‘¸lab_úelŽŸMª¹Reserv•¸èed›U w“ords:‘q€goto,˜labGelŽ¡The–ÎlabGel“statemenš¸èt“denes“a“named“jump“address“in“instruction“stream.‘ÜrThe“goto“statemen˜t“jumps“to“aŽŸ ®giv¸èen–U labšGel.‘q€The“lab˜els“m¸èust“b˜e“iden¸ètiers.‘q€F‘ÿ*¸or“example,ŽŸ´å‘+å:Äfor–¹N(i=1;“i<=10;“i++)“for“(j=1;“j<=10;“j++)ޤ Š=‘>Êrif–¹N(M[i,j]“<“0)“{Ž¡‘Q¯ªformat("Negative–¹Nmatrix“entry,“exiting\n");Ž¡‘Q¯ªgoto‘¹Nexitloop;Ž¡‘>Êr};Ž¡‘+å:label‘¹Nexitloop;Ž¡‘+å://–¹Nprocessing“continues“...ŽŸؼ¹wš¸èould–U bGe“equiv‘ÿqÐalen˜t“toަ‘+å:Äif–¹N(any(M<0))“format("Negative“matrix“entry,“exiting\n");ŽŸؼ¹The–Ígoto“statemenš¸èts“are“loGcal“to“a“function.‘Ù5All“goto“addresses“m˜ust“bšGe“dened“as“lab˜els“in“the“function.ޤ ®Gotos–U inš¸èto“bloGc˜ks“or“loGops“are“curren˜tly“allo˜w˜ed“but“ma˜y“cause“unpredictable“results.Ž©ؼThink–Îtš¸èwice“bGefore“y˜ou“use“goto.‘D{In“almost“all“cases“it“can“bGe“a˜v˜oided“b˜y“using“the“return,–ébreak,“or‘Îcon˜tin˜ueŽ¡statemen¸èts.ަSee–U also:‘q€2.6“(return),“2.7“(break).ŽŽŽŒ‹ë Û_2 ý ~?Ÿ„€ÕÁGŽÅ3.‘ñ8Other‘Õstatemen®>ts’gGy¹5ŽŽ ÕÁ ýV¯À3Ž‘ÁOther‘G\statemenctsŽŸèÂ3.1Ž‘¾callŽ©Mª¹Reserv•¸èed‘U w“ord:‘q€callޤؼF‘ÿ*¸unction–U call“syn¸ètax:ŽŸ²4‘+å:Ä[y1,y2..]–¹N=“f(x1,x2..)ŽŸÖ ¹calls–U f“with“input“argumenš¸èts“x1,x2..‘q€and“outputs“argumen˜ts“y1,y2..‘q€.Ž¡If–÷f(x1,x2..)‘R!appGears“alone“in“an“expression,‘ Õit“is“eectivš¸èely“called“with“one“output“argumen˜t,‘ Õwhic˜h“bGecomesŽŸ ®the–U v›ÿqÐalue“of“the“expression.–q€f(x1,x2..)“is–U equiv˜alen¸èt“toŽŸŠ‘+å:Äcall(f,x2,x2..).ŽŸ£b¹This–U notation“mak¸èes“it“pGossible“to“call“functions“indirectly“through“v‘ÿqÐariables,“and“to“write“functionals.Ž¡See–U also:‘q€3.2“(function)ŽŸ"lýÂ3.2Ž‘¾functionަ¹Reserv•¸èed›U w“ord:‘q€function˜Also˜uses˜spGecial˜tok“ens:–q€[˜]˜(˜)˜,˜...“;Ž¡F‘ÿ*¸unction–U denition“syn¸ètax:ŽŸ²4‘+å:Äfunction–¹N[y1,y2..]“=“f(x1,x2..)“LOCAL-DECL“{“stmt-sequence“}“;ŽŸÖ ¹orޤŠ‘+å:Äfunction–¹Ny“=“f(x1,x2..)“LOCAL-DECL“{“stmt-sequence“}“;Ž©£b¹orŽ¡‘+å:Äfunction–¹Nf(x1,x2..)“LOCAL-DECL“{“stmt-sequence“}“;ަ¹where–¯"yi“are“formal“output“argumenš¸èts“and“xi“are“formal“input“argumen˜ts.‘:,See“loGcal,‘ÐTglobal“for“what“LOCAL-ޤ ®DECL–U ma¸èy“bGe.Ž©ؼBy–/Fdefault,‘eÏoutput“argumenš¸èts“are“optional“and“input“argumen˜ts“are“obligatory‘ÿ*¸.‘ÿòThis“can“bGe“c˜hanged“b˜yŽ¡using– da“semicolon“in“the“argumenš¸èt“list.‘XAIden˜tiers“bšGefore“a“semicolon“b˜ecome“obligatory“and“iden¸ètiers“afterŽ¡the–U semicolon“are“declared“optional.ަExample:ŽŸŠ‘+å:Äfunction–¹N[y,z;]“=“f(x)“local(a)“{“/*“...“*/“};ŽŸ£b¹declares–U x,“y“and“z“obligatory“and“'a'“a“loGcal“v‘ÿqÐariable.ަAn–U output“argumen¸èt“should“bGe“declared“obligatory“if“it“is“also“used“as“input“in“the“function.ަThe–?Öellipsis“sign“(...)‘1¡ma¸èy“bšGe“app˜ended“to“the“input“or“output“formal“argumenš¸èt“list.‘1¡It“is“th˜us“pGossibleŽ¡to–Œudene“functions“with“v‘ÿqÐariable“n•¸èum“bGer–Œuof“argumen¸èts.‘See“argin,–šJargout,“SetArgOut,“Nargin,“Nargout‘ŒuforŽ¡details.ަY‘ÿ*¸ou–ÇLcan“dene“as“manš¸èy“functions“in“one“input“le“as“y˜ou“wish.‘ÈIn“order“to“call“a“T‘ÿ*¸ela-function“y˜ou“m˜ustŽ¡rst–U source“the“input“le“con¸ètaining“that“function.ަSee–U also:‘q€3.3“(lošGcal),“2.6“(return),“4.6“(argin),“4.5“(Nargin),“5.2“(sp˜ecial),“3.4“(pac¸èk‘ÿqÐage).ŽŽŽŒ‹  Û_2 ý ~?Ÿ„€ÕÁGŽÅ3.‘ñ8Other‘Õstatemen®>ts’gGy¹6ŽŽ ÕÁ ýV¯Â3.3Ž‘¾lo_úcal,‘¸globalŽŸMª¹Reserv•¸èed›U w“ords:‘q€loGcal,˜globalŽ©ؼV‘ÿ*¸ariables–<þappGearing“inside“functions,‘AÒwhicš¸èh“are“not“input“or“output“argumen˜ts,‘AÒare“either“loGcal“or“global.‘iuIfޤ ®they–WØare“loGcal,›X†they“are“similar“to“function“argumen¸èts,˜except“that“they“are“initialized“with“undened“v‘ÿqÐalueŽ¡bGefore–U en¸ètering“the“function.ަThe–U function“denition“is“of“the“formŽŸ´å‘+å:Äfunction–¹N[out1,out2...]“=“f(in1,in2...)“LOCAL-DECL“{“/*“body“*/“};ŽŸؼ¹where–U LOCAL-DECL“has“one“of“the“folloš¸èwing“v˜e“forms:ަ1.‘‹yLOCAL-DECL‘]Æcan–]ÈbGe“emptš¸èy‘ÿ*¸,‘_òin“whic˜h“case“all“v›ÿqÐariables“are“implicitly“loGcal,‘_òexcept“autoglobal“v˜ariablesŽ¡suc¸èh–U as“pi“and“eps.ަ2.‘q€LOCAL-DECL–U can“bšGe“the“k•¸èeyw“ord–U 'lo˜cal'.‘q€This“is“exactly“similar“to“case“1“ab˜o•¸èv“e.ަ3.›q€LOCAL-DECL–U can“bGe“the“k•¸èeyw“ord–U 'global'.˜This“mak¸èes“all“free“v‘ÿqÐariables“in“the“function“b•Go“dy‘U global.ަ4.‘ 5LOCAL-DECL‘ß÷can–à\bšGe“of“the“form“'lo˜cal(a,b,...)'.› 5This“mak¸èes“v‘ÿqÐariables“a,b,...˜loGcal,‘C,and“all“otherŽ¡free–‘*v›ÿqÐariables“global.‘%ŸIf“an“autoglobal“v˜ariables“suc¸èh“as“pi“or“eps“is“listed,›à-as“in“'loGcal(pi)',˜it“o•¸èv“erridesŽ¡the–«½autoglobal“attribute,‘dmaking“'pi'“lošGcal“and“uninitialized“in“the“function“b˜o˜dy‘ÿ*¸.‘uWSuc¸èh“practice“is“notŽ¡recommended‘U ho•¸èw“ev“er.ަ5.›´æLOCAL-DECL‘k’can–k—bGe“of“the“form“'global(a,b,...)'.˜This“mak¸èes“v‘ÿqÐariables“a,b,...˜global,‘q5and“all“other“freeŽ¡v›ÿqÐariables–U implicitly“loGcal.‘q€Autoglobal“v˜ariables“remain“global.ަExamples:Ž©´å‘Äfunction–¹Nf()“/*local*/“{y=2;“disp“y+pi};ŽŸؼ¹V‘ÿ*¸ariable–Ðùy“is“loGcal,›ïïbut“pi“is“not“since“it“is“autoglobal.‘å When“called,˜f()“will“output“5.14159,˜and“global“yŽ¡has–U not“bGeen“aected.‘q€Nothing“cš¸èhanges“if“y˜ou“uncommen˜t“the“k˜eyw˜ord“loGcal.ަ‘+å:Äfunction–¹NV“=“ddx(u)ޤ Š=‘+å:global(imax,dx)Ž¡‘+å:{Ž¡‘>ÊrV–¹N=“zeros(imax);Ž¡‘>Êrcoeff–¹N=“1/(2*dx);Ž¡‘>ÊrV[2:imax-1]–¹N=“(u[3:imax]“-“u[1:imax-2])*coeff;Ž¡‘>ÊrV[1]–¹N=“V[imax-1];Ž¡‘>ÊrV[imax]–¹N=“V[2];Ž¡‘+å:};ŽŸؼ¹This–éexample“computes“the“nš¸èumerical“deriv‘ÿqÐativ˜e.‘WnThe“v‘ÿqÐariables“cošGe“is“lo˜cal“since“it“is“not“men¸ètioned“in“theŽ© ®global‘U list.ޤؼSee–U also:‘q€3.2“(function),“3.4“(pac¸èk‘ÿqÐage).ŽŸ#ÃÂ3.4Ž‘¾pac k‘ÿ@ ageŽŸMª¹Reserv•¸èed‘U w“ord:‘q€pac“k‘ÿqÐageŽ¡The–i¿pacš¸èk‘ÿqÐage“mec˜hanism“is“for“hiding“names“loGcal“to“a“group“of“functions“and“other“statemen˜ts“from“globalަaccess.‘q€Syn¸ètax:ŽŽŽŒ‹)‘ Û_2 ý ~?Ÿ„€ÕÁGŽÅ4.‘ñ8In®>trinsic‘Õfunctions’c@¹7ŽŽ ÕÁ ýV¯‘Äpackage–¹N"mypackage"“LOCAL-DECL“{“/*“body“*/“};Ž©ؼ¹Naming–ÜKis“optional:‘5if“the“pacš¸èk‘ÿqÐage“is“not“named“explicitly‘ÿ*¸,‘ôvthe“curren˜t“input“le“name“is“used.‘I9If“y˜ou“use“oneޤ ®pacš¸èk‘ÿqÐage–pGer“one“input“le,‘$trinsic‘Õfunctions’c@¹8ŽŽ ÕÁ ýV¯Â4.3Ž‘¾absޤMª¹In¸ètrinsic‘U function:‘q€absŽ©ؼabs(x)–{ureturns“the“absolute“v‘ÿqÐalue“of“x,‘… whicš¸èh“ma˜y“bGe“of“an˜y“n˜umeric“ob‘Ž0ject.‘ä~If“x“is“an“arra˜y‘ÿ*¸,‘… the“opGerationŽŸ ®is–U pšGerformed“comp˜onen•¸èt“wise.‘q€If–U x“is“a“string,“an“inš¸èteger“v˜ector“of“the“c˜haracter“ASCIšGI“co˜des“is“returned.ŽŸ#ÃÂ4.4Ž‘¾min,‘¸maxŽ¡¹In¸ètrinsic–U functions:‘q€min,“maxަmin(x)–U returns“the“smallest“elemenš¸èt“of“arra˜y“x,“or“x“itself“if“x“is“scalar.ަ[m,p]–U =“min(x)“returns“the“minimš¸èum“in“m“and“the“minim˜um“pGosition“in“p.ަmin(x,y)–i‡returns“the“smaller“of“x“and“y‘ÿ*¸.‘®µIf“bGoth“are“arraš¸èys,‘n¡their“dimensions“m˜ust“agree.‘®µIf“one“is“scalar,‘n¡itŽŸ ®is–U promoted“to“arra¸èy“if“needed.ަmin(x,y›ÿ*¸,...,z)–U eectiv¸èely“expands“to“min(x,min(y˜,...z)...).ަThe–U function“max“wš¸èorks“similarly‘ÿ*¸.‘q€The“argumen˜ts“ma˜y“not“bGe“complex.ŽŸ#ÃÂ4.5Ž‘¾Nargin,‘¸NargoutŽ¡¹In¸ètrinsic–U functions:‘q€Nargin,“NargoutަNargin()–kreturns“the“n•¸èum“bGer–kof“optional“argumenš¸èts“passed“to“curren˜t“function.‘³)Optional“argumen˜ts“areޤ ®spGecied–4˜using“the“ellipsis“(...)›f¨notation“in“the“formal“argumen¸èt“list.˜Y‘ÿ*¸ou“ma¸èy“not“use“Nargin()“in“functionsŽ¡whose–U argumen¸èt“list“doGes“not“end“with“an“ellipsis.ަNargout()–¨Œwš¸èorks“similarly–ÿ*¸.‘kÅF“or–¨Œexample,‘ýgthe“follo˜wing“function“f“can“bGe“called“with“an˜y“n˜um˜bGer“of“in-Ž¡put/output–U argumenš¸èts;“it“displa˜ys“the“n˜um˜bGers:ŽŸ´å‘+å:Äfunction–¹N[...]“=“f(...)“{ޤ Š=‘>Êrformat("``–¹Ninput“args,“``“output“args.\n",Nargin(),Nargout())Ž¡‘+å:};ŽŸؼ¹See–U also:‘q€4.6“(argin)ŽŸ#ÃÂ4.6Ž‘¾argin,–¸argout,“SetArgOutŽŸMª¹In¸ètrinsic–U functions:‘q€argin,“argout,“SetArgOutަThe–’function“argin(n)“returns“the“n-th“optional“input“argumenš¸èt.‘(YThe“rst“optional“argumen˜t“has“n=1.ޤ ®Similarly‘ÿ*¸,–U argout(n)“returns“the“v‘ÿqÐalue“of“the“n-th“optional“output“argumen¸èt.ަSetArgOut(n,x)–U sets“the“n-th“optional“output“argumen¸èt“to“x.ަPlease–=´notice“that“the“functions“argin,‘u–argout“and“SetArgOut“do“not“counš¸èt“the“preceeding“'normal'“argumen˜ts,Ž¡but–U the“rst“optional“alw•¸èa“ys–U has“index“n=1.ަSee–U also:‘q€4.5“(Nargin)ŽŸ#ÃÂ4.7Ž‘¾nopŽŸMª¹In¸ètrinsic‘U function:‘q€nopŽŽŽŒ‹ ?W Û_2 ý ~?Ÿ„€ÕÁGŽÅ5.‘ñ8OpQÂerators’Œqó¹9ŽŽ ÕÁ ýV¯nop()–U generates“a“'no-opGeration'“instruction.›q€It“is“useful“(?)˜for“bšGenc¸èhmarking“purp˜oses.‘q€F‘ÿ*¸or“example,ޤؼnop();–U nop();“nop();“nop();“nop();Ž¡generates–U v¸èe“NOP“instructions“in“the“atcoGde“stream.ŽŸ(€òÀ5Ž‘ÁOppœeratorsŽŸèÂ5.1Ž‘¾op_úeratorsŽŸMª¹The–U T‘ÿ*¸ela“opGerators,“from“lo•¸èw“er–U to“higher“precedence:Ž©C!‘ÄOperator‘!"Association‘+êMeaningޤ Š=‘--------‘!"-----------‘+ê-------Ž¡‘:‘B"D-‘=höRange–¹Ncreation,“ex:“1:10,“-5:2.3:7Ž¡‘||‘=höleft‘/= Logical–¹NOR,“similar“to“CŽ¡‘&&‘=höleft‘/= Logical–¹NAND,“similar“to“CŽ¡‘!‘B"Dright‘*ƒ¾Logical‘¹NNOTŽ¡‘==,–¹N!=‘*ƒ¾left‘/= Equality“and“nonequalityŽ¡‘>,–¹N>=,“<,“<=‘+êleft‘/= ComparisonsŽ¡‘+,–¹N-‘3öZleft‘/= Addition“and“subtractionŽ¡‘*,–¹N/,“mod‘WÔleft‘/= Multiplication,“real“division,“modulusŽ¡‘**‘=höleft‘/= Matrix‘¹NmultiplicationŽ¡‘-,–¹N+‘3öZright‘*ƒ¾Unary“minus“and“plusŽ¡‘^‘B"Dright‘*ƒ¾Raising–¹Nto“powerŽŸfø¹The–U spšGecial“sym¸èb˜ols“'++'“and“''“are“not“actually“op˜erators“but“statemen¸èts.‘q€See“help“5.10“(++).ŽŸؼSee–’öalso“the“help“for“eac¸èh“individual“opGerators:‘í,5.9“(:),›¢l5.11“(ó !",š cmsy10¸jj¹),˜5.12“(&&),˜5.14“(==),˜5.15“(comparison),ޤ ®5.4–*Ò(+),›3H5.7“(-),˜5.5“(*),˜5.6“(/),˜5.3“(moGd),˜5.8“(**),˜5.16“(pGo•¸èw“er),˜5.13–*Ò(!).‘cfSee“also:‘\Y5.2“(spšGecial)“(t¸èyp˜e“helpŽ¡spGecial).ŽŸ"ÞÂ5.2Ž‘¾sp_úecialŽŸµ7‘ÄThe–¹NTela“special“charactersޤ Š=‘---------------------------ަ‘Char(s)‘+êMeanings,‘¹NusagesŽ¡‘-------‘+ê----------------Ž¡‘(–¹N)›!"Parentheses,“expression“grouping˜(a+b)*(a-c)Ž¡‘[–¹N]‘!"Brackets,“array“indexing‘FÛ’A[i,2:N-1]Ž¡‘H=Function–¹Ncall‘zÑì[a,b]“=“f(x,y,z);Ž¡‘H=Function–¹Ndefinition‘^zfunction“[a,b]“=“f(x,y,z)“{};Ž¡‘<[–¹N]>‘ž†Mapped“array“indexing‘U|A<[ivec,jvec]>Ž¡‘#(–¹N)‘WÔArray“constructor‘gì´#(1,2;“3,4)Ž¡‘{–¹N}‘!"Statement“grouping‘c3f{i++;“j++};Ž¡‘++‘%ÊpIncrementation‘vži++;Ž¡‘--‘%ÊpDecrementation‘vži--;Ž¡‘;‘*ƒ¾Statement–¹Nseparator‘^z{i++;“j++};Ž¡‘H=Separator–¹Nin“for“statement‘=höfor“(i=1;“i<=imax;“i++)“{};Ž¡‘H=Separator–¹Nof“obligatory/optional“args‘ rœfunction“y=f(x;“y)“{};Ž¡‘H=Separator–¹Nin“array“constructor‘*ƒ¾#(1,2;“3,4)Ž¡‘,‘*ƒ¾Separator–¹Nof“parameters‘K”àx“=“f(x,y)“+“3;Ž¡‘H=Separator–¹Nin“array“constructor‘*ƒ¾#(1,2;“3,4)ŽŽŽŒ‹ Hè Û_2 ý ~?Ÿ„€ÕÁGŽÅ5.‘ñ8OpQÂerators’‡rC¹10ŽŽ ÕÁ ýV¯More–U information“a¸èv‘ÿqÐailable:‘q€6.2“([),“6.3“(ó  b> cmmi10µ<¹[),“5.10“(++).ޤؼSee–U also:‘q€5.1“(opGerators).Ž©"¶ïÂ5.3Ž‘¾mo_údŽŸMª¹Reserv•¸èed‘U w“ord:‘q€moGdŽ¡a–¬@mošGd“b“giv¸èes“the“mo˜dulus,‘Âa“mo˜dulo“b.‘vàa“and“b“ma¸èy“b˜e“also“complex;‘×Ðin“that“case“the“mo˜dulus“is“tak¸èenޤ ®separately–Ð3for“the“real“and“imaginary“parts.‘E1The“mošGdulus“op˜erator“has“the“same“precedence“as“the“p˜oin•¸èt“wiseŽ¡m¸èultiplication–U '*'“and“real“division“'/'.ޤؼSee–U also:‘q€5.5“(*),“5.6“(/),“5.1“(opGerators)ަÂ5.4Ž‘¾+ŽŸMª¹Sp•Gecial‘U sym¸èb“ol:‘q€+Ž¡a–’œ+“b“is“the“normal“addition“opšGerator.‘)óIf“b˜oth“a“and“b“are“scalars,‘¡úthe“result“is“a“scalar.‘)óIf“one“of“them“isޤ ®arraš¸èy‘ÿ*¸,‘Qthe–Oüresult“is“an“arra˜y“of“the“same“size.‘oÉIf“bGoth“are“arra˜ys,‘Qtheir“dimensions“m˜ust“agree“and“the“resultŽ¡is–U an“arra¸èy‘ÿ*¸.ޤؼUnary–U plus“(+a)“returns“'a'“as“is.Ž¡See–U also:‘q€5.7“(-),“5.10“(++),“5.1“(opGerators)ަÂ5.5Ž‘¾*ŽŸMª¹Sp•Gecial‘U sym¸èb“ol:‘q€*Ž¡a–="*“b“is“the“normal“(pGoin•¸èt“wise)›="m“ultiplication˜op•Gerator.‘iIf˜b“oth˜a˜and˜b˜are˜scalars,‘Aïthe˜result˜is˜a˜scalar.‘iIfޤ ®one–Eæof“them“is“arraš¸èy‘ÿ*¸,‘Hòthe“result“is“an“arra˜y“of“the“same“size.‘lmIf“bGoth“are“arra˜ys,‘Hòtheir“dimensions“m˜ust“agreeŽ¡and–U the“result“is“an“arra¸èy‘ÿ*¸.ޤؼSee–U also:‘q€5.8“(**),“5.1“(opGerators)ަÂ5.6Ž‘¾/ŽŸMª¹Sp•Gecial‘U sym¸èb“ol:‘q€/Ž¡a–™u/“b“is“the“normal“(pšGoin•¸èt“wise)–™udivision“op˜erator.‘>€If“b˜oth“a“and“b“are“scalars,‘ª‹the“result“is“a“scalar.‘>€If“oneޤ ®of–7¢them“is“arraš¸èy‘ÿ*¸,‘=ˆthe“result“is“an“arra˜y“of“the“same“size.‘g«If“bGoth“are“arra˜ys,‘=ˆtheir“dimensions“m˜ust“agree“andŽ¡the–U result“is“an“arra¸èy‘ÿ*¸.ޤؼSee–U also:‘q€5.5“(*),“5.3“(mošGd),“5.1“(op˜erators)ަÂ5.7Ž‘¾-ŽŸMª¹Sp•Gecial‘U sym¸èb“ol:‘q€-Ž¡a–uë-“b“is“the“subtraction“opšGerator.‘ÓáIf“b˜oth“a“and“b“are“scalars,‘~the“result“is“a“scalar.‘ÓáIf“one“of“them“is“arra¸èy‘ÿ*¸,ޤ ®the–~Îresult“is“an“arraš¸èy“of“the“same“size.‘î‹If“bGoth“are“arra˜ys,‘‰:their“dimensions“m˜ust“agree“and“the“result“is“anŽ¡arra¸èy‘ÿ*¸.ޤؼUnary–U minš¸èus“(-a)“is“the“negativ˜e“of“a.Ž¡See–U also:‘q€5.4“(+),5.10“(++),5.1“(opGerators)ŽŽŽŒ‹ RÅ Û_2 ý ~?Ÿ„€ÕÁGŽÅ5.‘ñ8OpQÂerators’‡rC¹11ŽŽ ÕÁ ýV¯Â5.8Ž‘¾**ŽŸMª¹Sp•Gecial‘U sym¸èb“ol:‘q€**Ž©ؼT**U›…eis–…rthe“generalized“matrix“proGduct“of“T˜and“U.“If“T˜has“compGonen¸èts“T[i,..,j,k]“and“U˜has“compGonen¸ètsޤ ®U[a,b,c,...],› Athen–s (T**U)[i,..,j,b,c,...]‘&$=“sum(T[i,..,j,k]*U[k,b,c,...],k=1:kmax),˜i.e.‘&$it“is“a“con¸ètraction“of“tensorsŽ¡T–(¾and›(õU“with˜respGect˜to˜the˜innermost˜dimensions,‘]êwhic•¸èh˜m“ust˜agree.‘ìþIn˜case˜of˜matrices˜**˜th“us˜giv“esŽ¡the–U4ordinary“matrix“prošGduct.‘q¼If“one“or“b˜oth“op˜erands“are“scalars,‘•9T**U›Tòis“the“same“as“T*U˜(pGoin•¸èt“wiseŽ¡m¸èultiplication).ަSee–U also:‘q€5.5“(*),“5.1“(opGerators)ŽŸ#ÃÂ5.9Ž‘¾:‘ÿ v oid‘¸rangeŽŸMª¹Sp•Gecial‘U sym¸èb“ol:‘q€':'ަa:step:b–n!creates“a“vš¸èector“of“v‘ÿqÐalues“#(a,a+step,a+2*step,...)‘¼„suc˜h“that“all“elemen˜ts“are“less“or“equal“than“b.Ž¡a:b–zxcreates“a“range“using“unit“step.›á‡A‘znlone“':'‘¼/stands“for“the“V‘ÿ*¸oid“v‘ÿqÐalue.˜When“used“as“an“arra¸èy“subscript,Ž¡it–U stands“for“the“en¸ètire“range,“for“example“A[:,3]“refers“to“the“third“column“of“matrix“A.ަSee–U also:‘q€5.1“(opGerators)ŽŸ#ÃÂ5.10Ž‘%}¨++,‘¸ŽŸMª¹Sp•Gecial›U sym¸èb“ols:‘q€++,˜ަThe–/¸statemenš¸èt“a++“incremen˜ts“a“b˜y“one.‘eThe“statemen˜t“a“decremen˜ts“a“b˜y“one.‘eNotice“that“these“are“notŽ¡opGerators–U but“statemen¸èts“in“T‘ÿ*¸ela.ަSee–U also:‘q€5.4“(+)ŽŸ#ÃÂ5.11Ž‘%}¨or‘¸ó!!",š cmsy10ÌjjŽŸMª¹Sp•Gecial‘U sym¸èb“ol:‘q€¸jjަ¹a–ñÀ¸jj“¹b“is“the“logical“OR‘ñ˜of“a“and“b.‘GaThe“opšGerands“m¸èust“b˜e“inš¸èteger“v‘ÿqÐalued.‘GaF‘ÿ*¸or“arra˜y“opGerand(s),‘èthe“ORŽ¡opšGeration–U is“applied“comp˜onen•¸èt“wise.ަSee–U also:‘q€5.12“(&&),“5.1“(opGerators)ŽŸ#ÃÂ5.12Ž‘%}¨and‘¸&&ŽŸMª¹Sp•Gecial‘U sym¸èb“ol:‘q€&&ަa–}&&“b“is“the“logical“AND‘Pof“a“and“b.‘y–The“opšGerands“m¸èust“b˜e“inš¸èteger“v‘ÿqÐalued.‘y–F‘ÿ*¸or“arra˜y“opGerand(s),‘-ÔtheŽ¡AND–U opšGeration“is“applied“comp˜onen•¸èt“wise.ަSee–U also:‘q€5.11“(¸jj¹),5.1“(opGerators)ŽŸ#ÃÂ5.13Ž‘%}¨not‘¸!ŽŸMª¹Sp•Gecial›U sym¸èb“ol:‘q€!,˜op“erators˜(t¸èyp“e˜help˜op“erators)ަ!a–îüis“the“logical“NOT‘îâof“a.‘OtThe“opšGerand“m¸èust“b˜e“in¸èteger“v‘ÿqÐalued.‘OtIf“the“op˜erand“is“an“inš¸èteger“arra˜y‘ÿ*¸,‘jthe“resultŽ¡is–U inš¸èteger“arra˜y“also,“otherwise“the“result“is“in˜teger“scalar.ŽŽŽŒ‹ \7 Û_2 ý ~?Ÿ„€ÕÁGŽÅ5.‘ñ8OpQÂerators’‡rC¹12ŽŽ ÕÁ ýV¯On–ÑEcommand“prompt,›ë¤'‘`!'‘Eexecutes“an“opGerating“system“command,˜if“it“is“the“rst“c¸èharacter“on“line.‘EIn“t-lesޤ ®this–U extra“meaning“of“'‘`!'‘q€doGes“not“exist,“but“yš¸èou“m˜ust“use“the“'system'“function“explicitly‘ÿ*¸.ŽŸ#ÃÂ5.14Ž‘%}¨equal,–¸==,“notequal,“!=ŽŸMª¹Sp•Gecial›U sym¸èb“ols:‘q€==,˜!=Ž©ؼa–,>==“b“is“the“equalit¸èy“test“opšGerator.‘càIf“b˜oth“op˜erands“are“scalars,‘4kthe“result“is“either“1“or“0.‘càIf“one“op˜erandŽ¡is–o„nš¸èumeric“arra˜y“and“the“other“one“is“scalar,‘vthe“result“is“an“in˜teger“arra˜y“of“0's“and“1's“of“the“same“size“asŽ¡the–«arra¸èy“opšGerand.‘tœIf“b˜oth“op˜erands“are“arraš¸èys“of“the“same“size,‘Áthe“result“is“again“an“in˜teger“arra˜y“of“0'sŽ¡and–e»1's.‘£RBut“if“the“opGerands“are“arraš¸èys“of“dieren˜t“size,‘iâthe“result“is“0“(in˜teger“scalar).‘£RStrings“are“handledŽ¡as–inš¸èteger“arra˜ys“of“their“ASCI•GI‘ìco“des,‘:according–to“their“in˜ternal“represen˜tation.‘VvF‘ÿ*¸or“other“t˜ypGes“of“ob‘Ž0jects,Ž¡for–U example“functions,“the“result“is“1“only“if“the“ob‘Ž0jects“are“exactly“equal.ަa–U !=“b“is“the“'not-equal'“opGerator.‘q€It“is“analogous“to“'=='.ަUnlik¸èe–O¢order-related“comparison“opšGerators“(µ<¹,–P»µ>¹,“µ<¹=,“µ>¹=),“the–O¢'=='“and“'‘`!='“op˜erators“nev¸èer“generate“anŽ¡error–U message“for“an¸èy“opGerands.ަSee–U also:‘q€5.15“(comparison),“5.1“(opGerators)ŽŸ#ÃÂ5.15Ž‘%}¨comparison:‘ÿ lt,–¸gt,“le,“geŽŸMª¹Sp•Gecial›U sym¸èb“ols:‘q€µ<¹,˜µ>¹,˜µ<¹=,˜µ>¹=ަThese–÷ÝopšGerators“ob¸èviously“test“whether“the“rst“op˜erand“is“less“than,› Œgreater“than,˜less“or“equal“than,˜orŽ¡greater–‡Yor“equal“than“the“second“opšGerand.‘+If“b˜oth“op˜erands“are“scalars,‘“çthe“result“is“scalar“(1“or“0).‘+If“oneŽ¡opGerand–žMis“arraš¸èy“and“the“other“one“is“scalar,‘°˜the“result“is“an“in˜teger“arra˜y“of“0's“and“1's.‘MIf“bšGoth“op˜erandsŽ¡are–U arraš¸èys,“their“dimensions“m˜ust“agree.‘q€The“result“is“then“again“an“in˜teger“arra˜y“of“0's“and“1's.ަThe–U opšGerands“ma¸èy“not“b˜e“nonnš¸èumeric,“nor“they“ma˜y“include“complex“n˜um˜bGers.ަSee–U also:‘q€5.14“(==),“5.1“(opGerators)ŽŸ#ÃÂ5.16Ž‘%}¨p_úo• w“erŽŸMª¹Sp•Gecial‘U sym¸èb“ol:‘q€ަa–ž›“b“is“a-raised-to-the-pšGo•¸èw“er-b.‘MðIf–ž›b˜oth“a“and“b“are“scalars,‘°ùthe“result“is“a“scalar.‘MðIf“one“of“them“is“arra¸èy‘ÿ*¸,Ž¡the–~Îresult“is“an“arraš¸èy“of“the“same“size.‘î‹If“bGoth“are“arra˜ys,‘‰:their“dimensions“m˜ust“agree“and“the“result“is“anŽ¡arra¸èy‘ÿ*¸.ަSee–U also:‘q€5.5“(*),“5.8“(**),“5.1“(opGerators)ŽŸ ÖIf–&A‘&is“an“arraš¸èy‘ÿ*¸,‘/xit“can“bGe“indexed“using“A[i,j,...,k].‘aÏThe“n˜um˜bGer“of“indices“m˜ust“bGe“equal“to“rank(A),“exceptŽ¡that–„ƒall“arraš¸èys“can“bGe“indexed“using“just“single“index,‘\in“whic˜h“case“the“arra˜y“is“indexed“in“attened“form.Ž¡The–‘×attened“indexing“is“useful“e.g.‘0hin“connection“with“nd(),‘¸æbGecause“nd()“returns“a“attened“index“v¸èector.Ž¡Flat–U indexing“is“also“generally“faster“than“ordinary“indexing“for“mš¸èultidimensional“arra˜ys.ަThe–tindices“maš¸èy“bGe“of“three“t˜ypGes.‘ÎS1)“in˜teger“scalars,‘{Í2)“in˜teger“v˜ectors,›{Í3)“V‘ÿ*¸oid“v‘ÿqÐalue“(notation“':'),˜whic¸èhŽ¡means–7í'whole“range'.‘gÅThe“rank“of“the“result“is“equal“to“rank(A)‘7æ-“n,‘=Äwhere“n“is“the“n•¸èum“bGer–7íof“in¸èteger“scalarŽ¡indices.ަSee–U also:‘q€6.3“(µ<¹[)ŽŽŽŒ‹ eÍ Û_2 ý ~?Ÿ„€ÕÁGŽÅ6.‘ñ8Other–ÕT‘ÿ ºela-related“material’/?>¹13ŽŽ ÕÁ ýV¯Â5.17Ž‘%}¨Mapp_úed‘¸indexingŽŸ³Ú‘ÄBesides–¹Nordinary“array“indexing,“accomplished“with“[“],“you“can“use“mapped“indexing“using“<[ޤ Š=‘]>.–¹NAssume“A“is“an“array“with“N“=“rank(A).“Assume“that“I1...IN“are“integer“arrays,“and“thatŽ¡‘their–¹Ndimensions“mutually“agree.“Then“A<[I1,I2,...,IN]>“is“a“collection“of“A's“components,“andŽ¡‘its–¹Nsize“is“equal“to“the“size“of“each“Ik.Ž¡‘Unlike–¹Nordinary“array“indexing,“in“mapped“indexing“the“size“of“the“result“is“not“determined“byŽ¡‘A,–¹Nbut“the“size“of“the“index“arrays.“Mapped“indexing“can“not“easily“be“returned“to“ordinaryŽ¡‘indexing,–¹Nhence“it“is“included“as“a“separate“operation“in“Tela.ŽŸ`'¹See–U also:‘q€6.2“([).ŽŸ(ÅÀ6Ž‘ÁOther–G\T‘þ®(ela-related“materialŽŸèÂ6.1Ž‘¾telakk‘ÿ@ aŽŸMª¹telakk‘ÿqÐa–{(T‘ÿ*¸eLa“Kernel“Kš¸èonstruction“A˜ccessory)“is“a“program“that“generates“new“T‘ÿ*¸ela“k˜ernels.‘It“is“imple-ޤ ®menš¸èted–Q.as“a“shell“script.‘eªIt“is“used“m˜uc˜h“as“a“C‘Pícompiler.‘eªC-tela“les“(.ct“les)“written“b˜y“y˜ou“can“bGeŽ¡compiled– Cand“linkš¸èed“in˜to“T›ÿ*¸ela“using“telakk‘ÿqÐa.‘RéF˜or“example,‘³ if“mš¸èystu.ct“con˜tains“y˜our“o˜wn“function“namedŽ¡m¸èyfunction,ŽŸ Ur‰ffÕÁGŸ´¯¤ Š=‘ÄThe–¹Nexecutable“mytela“is“a“full“Tela“plus“the“C-tela“functions“from“mystuff.ct.“The“helpŽ¡‘command–¹Nfinds“the“C-style“comment“/*“...“*/“following“the“function“header“automatically.Ž¡‘Also–¹Nname“completion“will“recognize“myfunction.“C-tela“code“is“C++“code“with“one“syntacticŽ¡‘extention:–¹Nthe“function“header“is“simpler“and“follows“Tela“conventions.“There“is“aŽ¡‘preprocessor,–¹Nnamed“ctpp,“which“converts“C-tela“to“ordinary“C++“by“transforming“functionŽ¡‘headers.–¹NTelakka“calls“ctpp,“the“system“C++“compiler“and“the“linker“automatically“as“needed.Ž¡‘You–¹Ncan“pass“other“object“files,“libraries“and“C“compilation“switches“to“telakka“as“you“need.Ž¡‘On–¹Nsystems“that“support“DLD“dynamic“linking“there“is“a“faster“method“to“bring“your“own“codeŽ¡‘in–¹NTela.“Just“compile“the“.ct“file“with“telakka“-c“to“produce“an“.o“file.“Then“use“the“linkŽ¡‘function–¹Nin“Tela“to“bring“the“functions“in“Tela“executable;“in“this“way“you“don't“have“toŽ¡‘generate–¹Na“full“new“copy“of“the“kernel.“The“link“function“does“not“exist“on“systems“that“doŽ¡‘not–¹Nhave“DLD.Ž¡¡¡¡ŸR‘Â6.2Ž‘7¾m2tŽ¡ŸYà¡¡¡‘Äm2t–¹Nis“Matlab“to“Tela“translator.“Usage“is“as“follows:ŽŸϤ‰ffÕÁGŸ4W‘2List–¹Nof“possible“command“line“options:Ž¡‘2-F–¹NIgnore“script“files“(process“Functions“only)“-S“Ignore“function“files“(processŽ¡‘2Scripts–¹Nonly)“-m“Multi-file“mode:“generate“.t“files“using“.m“file“basenames“-s“SilentŽ¡‘2mode,–¹Nsuppress“all“warnings“-d“Suppress“matrix“division“warnings“-h,“-?“Produce“thisŽ¡‘2messageŽ¡‘2Examples:Ž¡‘2m2t–¹N-F“*.m“>funcs.t“Compile“all“function“files“into“"funcs.t"“m2t“-Sm“*.m“Compile“allŽ¡‘2scripts–¹Nin“separate“t-filesŽŸfF‰ffÕÁGŽŽŒ‹sƒ Û_2 ý ~?Ÿ„€ÕÁGŽÅ6.‘ñ8Other–ÕT‘ÿ ºela-related“material’/?>¹14ŽŽ ÕÁ ýV¯‘ÄMany–¹NTela“functions“can“reside“in“one“source“file,“therefore“m2t“by“default“writes“to“standardޤ Š=‘output.–¹NIf“you“want“to“stick“to“Matlab“convention“and“use“only“one“function“per“file,“you“useŽ¡‘the–¹N-m“flag.Ž¡‘The–¹N-F“and“-S“arguments“are“useful“tools“for“selecting“either“only“function“M-files“or“scriptŽ¡‘M-files.–¹NThe“default“is“to“process“both“types“of“files.Ž¡‘It–¹Nis“important“to“realize“that“m2t“is“not“a“full-fledged“translator.“You“almost“always“haveŽ¡‘to–¹Nedit“its“input“in“order“to“run“it“suffesfully“in“Tela.“Despite“this“shortcoming,“manyŽ¡‘people–¹Nhave“found“m2t“extremely“useful.“Particularly,“m2t“has“difficulties“in“recognizingŽ¡‘vectors–¹Nbuilt“without“commas.“For“example,“in“Matlab“is“is“legal“to“writeŽŸfF‰ffÕÁG©¡‘2instead‘¹NofŽŸff‰ffÕÁG¦¡‘HHowever,–¹Nm2t“properly“recognizes“only“the“second“form“except“in“some“trivial“cases.Ž¡‘HKeep–¹Nthis“in“mind“when“writing“new“M-files.“The“other“weak“point“is“in“decidingŽ¡‘Hwhich–¹Nsymbol“is“a“function“and“which“symbol“is“a“matrix.“In“Matlab,“both“functionŽ¡‘Hcalls–¹Nand“array“references“use“(..)“parentheses.“In“Tela“array“refererence“mustŽ¡‘Huse–¹N[..]“brackets.“m2t“does“what“is“possible“to“guess“what“is“function“and“what“isŽ¡‘Hvariable,–¹Nbut“it“sometimes“guesses“wrong.Ž¡‘HIt–¹Nis“also“important“to“realize“that“m2t“can“be“misused,“i.e.“it“can“be“used“toŽ¡‘Htranslate–¹Ncopyrighted“M-files“to“Tela.“This“is“true“with“any“translator.“You“as“aŽ¡‘Huser–¹Nare“completely“responsible“for“ensuring“that“copyright“is“not“violated“whenŽ¡‘Husing‘¹Nm2t.Ž¡¡¡¡¡¡¡‘Hó$o´‹Ç cmr9Ï]‘¹NÄ]Ž©Š=‘Z³5If–¹NA“is“an“array,“it“can“be“indexed“using“A[i,j,...,k].“The“number“of“indicesŽ¡‘Z³5must–¹Nbe“equal“to“rank(A),“except“that“all“arrays“can“be“indexed“using“justŽ¡‘Z³5single–¹Nindex,“in“which“case“the“array“is“indexed“in“flattened“form.“TheŽ¡‘Z³5flattened–¹Nindexing“is“useful“e.g.“in“connection“with“find(),“because“find()Ž¡‘Z³5returns–¹Na“flattened“index“vector.“Flat“indexing“is“also“generally“faster“thanŽ¡‘Z³5ordinary–¹Nindexing“for“multidimensional“arrays.Ž¡‘Z³5The–¹Nindices“may“be“of“three“types.“1)“integer“scalars,“2)“integer“vectors,“3)Ž¡‘Z³5Void–¹Nvalue“(notation“':'),“which“means“'whole“range'.“The“rank“of“the“result“isŽ¡‘Z³5equal–¹Nto“rank(A)“-“n,“where“n“is“the“number“of“integer“scalar“indices.ަ‘HóÙ.œŒ ecrm0900ÃSee–$also:“6.3“(ó%5ùž" cmmi9Ð<Ã[)ŽŸŒø‘HÂ6.3Ž‘f¾Mapp_úed‘¸indexingŽŸYà‘Z³5ÄBesides–¹Nordinary“array“indexing,“accomplished“with“[“],“you“can“use“mappedŽ¡‘Z³5indexing–¹Nusing“<[“]>.“Assume“A“is“an“array“with“N“=“rank(A).“Assume“thatŽ¡‘Z³5I1...IN–¹Nare“integer“arrays,“and“that“their“dimensions“mutually“agree.“ThenŽ¡‘Z³5A<[I1,I2,...,IN]>–¹Nis“a“collection“of“A's“components,“and“its“size“is“equal“toŽ¡‘Z³5the–¹Nsize“of“each“Ik.Ž¡‘Z³5Unlike–¹Nordinary“array“indexing,“in“mapped“indexing“the“size“of“the“result“isŽ¡‘Z³5not–¹Ndetermined“by“A,“but“the“size“of“the“index“arrays.“Mapped“indexing“can“notŽ¡‘Z³5easily–¹Nbe“returned“to“ordinary“indexing,“hence“it“is“included“as“a“separateŽ¡‘Z³5operation–¹Nin“Tela.ŽŸŠ=‘HÃSee–$also:“6.2“([).ŽŽŽŒ‹– Û_2 ý ~?Ÿ„€ÕÁGŽÅ7.‘ñ8Other–ÕT‘ÿ ºela-related“material’/?>¹15ŽŽ ÕÁ ýV¯‘HÀ7Ž‘_Á Other–G\T‘þ®(ela-related“materialŽŸÞÍ‘HÂ7.1Ž‘f¾telakk‘ÿ@ aŽ©Yà‘HÃtelakk‘ÿ|ya–Q<(T‘ÿ:¶eLa“Kernel“Kš¾funcs.t“Compile“all“function“files“into“"funcs.t"“m2t“-Sm“*.mŽ¡‘k³4Compile–¹Nall“scripts“in“separate“t-filesŽŸfF‰ffÕÁGŸ ¨‘Z³5Many–¹NTela“functions“can“reside“in“one“source“file,“therefore“m2t“by“defaultŽ¡‘Z³5writes–¹Nto“standard“output.“If“you“want“to“stick“to“Matlab“convention“and“useŽ¡‘Z³5only–¹None“function“per“file,“you“use“the“-m“flag.Ž¡‘Z³5The–¹N-F“and“-S“arguments“are“useful“tools“for“selecting“either“only“functionŽ¡‘Z³5M-files–¹Nor“script“M-files.“The“default“is“to“process“both“types“of“files.Ž¡‘Z³5It–¹Nis“important“to“realize“that“m2t“is“not“a“full-fledged“translator.“You“almostŽ¡‘Z³5always–¹Nhave“to“edit“its“input“in“order“to“run“it“suffesfully“in“Tela.“DespiteŽ¡‘Z³5this–¹Nshortcoming,“many“people“have“found“m2t“extremely“useful.“Particularly,“m2tŽ¡‘Z³5has–¹Ndifficulties“in“recognizing“vectors“built“without“commas.“For“example,“inŽ¡‘Z³5Matlab–¹Nis“is“legal“to“writeަ‰ffÕÁG¡‘k³4instead‘¹NofŽŸff‰ffÕÁGŽŽŒøŒ¯ƒ’À;èÛ_2ÕÁGó%5ùž" cmmi9ó$o´‹Ç cmr9ó!!",š cmsy10ó]fŒ ecbx1000óqLË ectt0900óÙ.œŒ ecrm0900ó¥!¢N ecbx1200ó&Lt$ffffecbx1440óø8‹ ecsi1000óŒ6 ecss1000óqLË ectt1000óþÖëI½q½qecss2074ó 1ê± ecrm1000ó !",š cmsy10ó  b> cmmi10ù™Nßßßß