<div dir="ltr"><div><div><div>Hi Tobias,<br><br>More detailed information about matlab's COM interface can be found here:<br><a href="http://www.mathworks.nl/help/matlab/call-matlab-com-automation-server.html">http://www.mathworks.nl/help/matlab/call-matlab-com-automation-server.html</a><br>
<br></div>There are a few functions available to pass variables, character array's, matrices and workspaces between the two applications, without the need to convert strings. The execute command should be used to execute scripts; not for passing variables (although you can do this off course). Large objects (like bitmap images) could also be passed by using external files (i.e. only passing the name of the created file).<br>
<br></div>Best<br></div>Paul<br><div><div><div><br></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 13 May 2013 12:19, Tobias <span dir="ltr"><<a href="mailto:tobias.fw@gmail.com" target="_blank">tobias.fw@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Paul,<br><br>thanks a lot for this code. It works very well. There are some issued I have, though.<br><br>From your script I understand that there are at least two ways of getting data from Matlab to E-Prime: Execute and getfullmatrix. Are there other ways?<br>
Also, it seems that there is no way of transmitting a variable from E-Prime to Matlab, only string values such as "<span style="font-family:courier new,monospace">b = a + a</span>".<br>Of course I could always use sth like <br>
<span style="font-family:courier new,monospace"><br>Result = MatLab.Execute(CStr(eprimeVar))<br><br>If I wanted to get the variable eprimeVar from E-Prime to Matlab. But maybe there is an easier way?<br><br>Best,<br>Tobias<br>
<br><br><br></span>Am Dienstag, 7. Mai 2013 17:01:32 UTC+2 schrieb Paul Groot:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">
<div><div>I don't think eprime requires a special plugin like presentation, because matlab can also be started as a so called COM server:<br><br><span style="font-family:courier new,monospace">Dim MatLab As Object<br>
Dim Result As String<br>Dim MReal(1, 3) As Double<br>Dim MImag(1, 3) As Double<br><br>Set MatLab = CreateObject("Matlab.<u></u>Application")<br><br>'Executing other MATLAB commands<br>Result = MatLab.Execute("surf(peaks)")<br>
Debug.Print Result <br><br>Result = MatLab.Execute("a = [1 2 3 4; 5 6 7 8]")<br>Debug.Print Result <br><br>Result = MatLab.Execute("b = a + a ")<br>Debug.Print Result <br><br>'Bring matrix b into VB program<br>
MatLab.GetFullMatrix "b", "base", MReal, MImag<br><br>Debug.Print MReal(1,0)<br>Debug.Print MReal(1,1)<br>Debug.Print MReal(1,2)<br>Debug.Print MReal(1,3)</span><br><br><br></div><div>The above will print the following to the Debug window:<br>
<br><span style="font-family:courier new,monospace">a =<br><br> 1 2 3 4<br> 5 6 7 8<br><br><br><br>b =<br><br> 2 4 6 8<br> 10 12 14 16<br><br><br>10<br>12<br>14<br>
16<br></span><br></div><div>The matlab figure window won't be visible though...<br><br></div>Best,<br></div>Paul<br><div><div><br></div></div></div></div></div><div><br><br><div class="gmail_quote"><div class="im">On 7 May 2013 16:26, David McFarlane <span dir="ltr"><<a>mcfa...@msu.edu</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Can you start your MATLAB script from a command line? If so, then you might try using the E-Basic "Shell()" function, see that topic in the E-Basic Help facility. For a user example of this, see <a href="http://support.pstnet.com/forum/Topic1338-8-2.aspx" target="_blank">http://support.pstnet.com/<u></u>foru<u></u>m/Topic1338-8-2.aspx</a> . This still leaves a lot to be desired, and beyond that I have no idea.<br>
<br>
-----<br>
David McFarlane<br>
E-Prime training online: <a href="http://psychology.msu.edu/Workshops_Courses/eprime.aspx" target="_blank">http://psychology.msu.edu/<u></u>Wor<u></u>kshops_Courses/eprime.aspx</a><br>
Twitter: @EPrimeMaster (<a href="https://twitter.com/EPrimeMaster" target="_blank">https://twitter.com/<u></u>EPrimeMas<u></u>ter</a>)<br>
<br>
/----<br>
Stock reminder: 1) I do not work for PST. 2) PST's trained staff take any and all questions at <a href="http://support.pstnet.com/e%2Dprime/support/login.asp" target="_blank">http://support.pstnet.com/e%<u></u>2D<u></u>prime/support/login.asp</a> , and they strive to respond to all requests in 24-48 hours, so make full use of it. 3) In addition, PST offers several instructional videos on their YouTube channel (<a href="http://www.youtube.com/user/PSTNET" target="_blank">http://www.youtube.com/user/<u></u>P<u></u>STNET</a> ). 4) If you do get an answer from PST staff, please extend the courtesy of posting their reply back here for the sake of others.<br>
\----<div><br>
<br>
<br>
At 5/7/2013 10:08 AM Tuesday, Cognitology wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><div>
Hi,<br>
Never heard of a way to interface matlab from E-Prime, I'd be interested if anyone would have a way. Of course, you could compile from within matlab and try to go from there, but I suspect the amount of effort would really not be worth it. You could, of course, just forego e-prime and try Psychtoolbox.<br>
Best,<br>
Michiel<br>
<br></div></div>
From: <mailto:<a>e-p...@googlegroups.<u></u>c<u></u>om</a>><a>e-p...@googlegroups.com</a> [mailto:<a>e-p...@googlegroups.<u></u>c<u></u>om</a>] On Behalf Of Tobias<div class="im"><div>
<br>
Sent: 7. May 2013 13:31<br></div></div>
To: <mailto:<a>e-p...@googlegroups.<u></u>c<u></u>om</a>><a>e-p...@googlegroups.com</a><div class="im"><div><br>
Subject: Re: Polhemus<br>
<br>
To be more precisely: What I need to do is to start a matlab script from E-Prime.<br>
"Presentation" has some plugin to connect with Matlab, but E-Prime seems not to have that. But there may be another way...<br>
<br>
Am Montag, 6. Mai 2013 15:39:19 UTC+2 schrieb Tobias:<br>
Dear all,<br>
<br>
Does anyone have experience with running Polhemus Liberty (the motion tracking system) with E-Prime?<br>
<br>
Best,<br>
Tobias<br>
</div></div></blockquote><div><div class="im">
<br>
-- <br>
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br></div>
To unsubscribe from this group and stop receiving emails from it, send an email to <a>e-prime+u...@<u></u>googlegrou<u></u>ps.com</a>.<br>
To post to this group, send email to <a>e-p...@googlegroups.com</a>.<br></div><div class="im"><div><div>
For more options, visit <a href="https://groups.google.com/groups/opt_out" target="_blank">https://groups.google.com/<u></u>grou<u></u>ps/opt_out</a>.<br>
<br>
<br>
</div></div></div></blockquote></div><br></div>
</blockquote><div class="im">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:e-prime%2Bunsubscribe@googlegroups.com" target="_blank">e-prime+unsubscribe@googlegroups.com</a>.<br>
To post to this group, send email to <a href="mailto:e-prime@googlegroups.com" target="_blank">e-prime@googlegroups.com</a>.<br></div>
To view this discussion on the web visit <a href="https://groups.google.com/d/msg/e-prime/-/kIUzT6nN__AJ" target="_blank">https://groups.google.com/d/msg/e-prime/-/kIUzT6nN__AJ</a>.<div class="HOEnZb"><div class="h5"><br>
For more options, visit <a href="https://groups.google.com/groups/opt_out" target="_blank">https://groups.google.com/groups/opt_out</a>.<br>
<br>
<br>
</div></div></blockquote></div><br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.<br />
To post to this group, send email to e-prime@googlegroups.com.<br />
For more options, visit <a href="https://groups.google.com/groups/opt_out">https://groups.google.com/groups/opt_out</a>.<br />
<br />
<br />