Question: Trouble using Matlab translation commands

God forgive me, I know this is a bad way to start asking for help, but it is such a PITA to figure out how to get WYSIWYG representation of even simple Maple worksheets onto this forum.  I searched the catacombs of Rome looking for a simple way to attach a couple of (very small) Maple & Matlab files relevent to my current angst, but to no avail; the dragon of legacy unix protocol has slain its latest unsuspecting victim.

And what good, may I ask, can come the ability to export wrksheets as*.pdf, *.rtf, *.xml, *.wtf... when cut and paste do not work as expected in primes?  I may as well type the whole thing in from scratch, there are so many dropped characters, missing line returns, and color fonts cut down in the "primes" of strife...

Ok, I have returned to low earth orbit now, and promise not bite anyone who chooses to offer re-entry assistance...

The Maple code below was entered following the command formats obtained from Help: Maple error messages are bolded.

  • From the first error mesage, I gather that maple has trouble understanding a particular Matlab command syntax at line 152 (see italicized & underlined text below);
  • I also gather that Maple does not like the way I attempted to define the run-on string "pothole", yet I don't have enough experience with maple to understand what I might do to try to clean things  up a bit..

Any help in understanding these issues would be sincerely appreciated.

P.S. Is there a way to upload/attach and share actual Maple files to these forums?  If this question has been answeed before, then perhaps someone could point me towards the right thread.

Scott M.

 

restart with Matlab :
FileLocationd:=cat( kernelopts (datadir ), "/Matlab/zernfun.m" ):
mwfile:=dcat kernelopts (datadir) , "/Matlab/zernfun.mw" ):
FromMFile (FileLocation, mwfile,'string') ;
Error, (in Matlab:-FromMFile) on line 152 of C:\Program Files\Maple 14\data/Matlab/zernfun.m, syntax error
rpowern = arrayfun(@(p)r

^
%
"C:\Program Files\Maple 14\data/Matlab/zernfun.mw"

# Line 152 from the Matlab file colored in red below

pothole:'=("if rpowers 1 == 0
rpowern = arrayfun @ p r.^p, rpowers 2 :end ,'UniformOutput', false ;
rpowern = cat 2, rpowern : ;
rpowern = ones length_r, 1 rpowern ;
else
rpowern = arrayfun @ p r.^p, rpowers,'UniformOutput', false ;
rpowern = cat 2, rpowern : ;
end")

FromMatlab (pothole,'string' );
Error, invalid input: Matlab:-FromMatlab expects its 1st
argument, cmd, to be of type string, but received pothole

whattype( pothole) ;


FromMatlab ("if rpowers 1 == 0
rpowern = arrayfun @ p r.^p, rpowers 2 :end ,'UniformOutput', false ;
rpowern = cat 2, rpowern : ;
rpowern = ones length_r, 1 rpowern ;
else
rpowern = arrayfun @ p r.^p, rpowers,'UniformOutput', false ;
rpowern = cat 2, rpowern : ;
end",'string' );
Error, unable to delimit strings/identifiers

FromMatlab( "if rpowers 1 == 0 rpowern = arrayfun @ p r.ˆp, rpowers 2 :end ,'UniformOutput', false ; rp)
FromMatlab "rpowern = arrayfun @ p r.^p, rpowers 2 :end ,'UniformOutput', false ;",'string' ;

Please Wait...