by mhx@[EMAIL PROTECTED]
(Marcel Hendrix)
Mar 24, 2008 at 09:46 AM
Albert van der Horst <albert@[EMAIL PROTECTED]
> writes: Re: Matlab
executes Forth commands
> In article <17903932203559@[EMAIL PROTECTED]
>, Marcel Hendrix <mhx@[EMAIL PROTECTED]
>
wrote:
>>Here is small utility to let Matlab execute Forth
>>commands. It assumes you have the words MAT@[EMAIL PROTECTED]
and MAT!
>>to access Matlab matrices from your Forth interpreter
>>(Forth must start Matlab in such a way that both programs
>>have a console window). The array answer{ (on the Forth
>>side) is used to quickly get numerical results to Matlab.
> I'm unclear about how the communication works.
> Do MAT@[EMAIL PROTECTED]
and MAT! access some sort of shared memory between the Forth
> and Matlab?
That's the way I do it, but you might try DDE (on Windows). I have
a DDE interface to Matlab in iForth, and I think SwiftForth and VFX
have one too. (It's slightly more challenging than box4.)
The interface spec. of these two words is:
S" FORTHCMD" m2f{ MAT@[EMAIL PROTECTED]
\ copy FORTHCMD matrix from Matlab to FSL-style
Forth dmatrix
newcmd{ S" NEWCMD" MAT! \ copy FSL-style dmatrix to Matlab NEWCMD (must
exist)
Of course, you also want S" aap" MEXECUTE (let Matlab execute Forth
command),
but I didn't use that in the posting.
-marcel