OpenViBE forum

The OpenViBE community
It is currently Thu Dec 14, 2017 10:10 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Fri May 19, 2017 8:18 pm 
Offline

Joined: Tue Apr 18, 2017 5:44 am
Posts: 13
Hello,

I would like to embed some variables created in Matlab into Openvibe so that i can process in Openvibe through Matlab scripting.

However, i had no success at all. When i implement "load('xxxx.mat')" into initialize function it gives me error and can't get even data from EEG headset. When i try to implement into process function this time another OV_BOX_xxxxxxx seemed however when i try to get in nothing shows up.

By the way, i came across everytime i run the xml, i came across different OV_BOX _xxx name.

Does someone know how to do or tried this?

Thanks.


Top
 Profile  
Reply with quote  
PostPosted: Mon May 22, 2017 7:25 am 
Offline

Joined: Tue Dec 04, 2012 3:53 pm
Posts: 599
Location: INRIA Rennes, FRANCE
Hi Hkn,

you can try to get matlab to stop (breakpoint) on errors and then inspect the contents of the various variables and see if they make sense and whats in them.

In particular, loading a file might fail if the file in question is not in the current directory of the matlab interpreter -- in that case, provide the full path to the file.

The OV_BOX_XXXX are unique (or random) identifiers given to boxes run time. Each keeps the information specific to one Matlab scripting box running code. This way, multiple matlab boxes can be run at the same time, each with their own information and state.

The .m files among the matlab box tutorials shipped with OpenViBE should show how to stream data into Designer, if thats what you want to do.


Cheers,
Jussi


Top
 Profile  
Reply with quote  
PostPosted: Mon May 22, 2017 8:32 am 
Offline

Joined: Tue Apr 18, 2017 5:44 am
Posts: 13
Thanks Jussi, with your suggestion i add a line "addpath(genpath('C:\Program Files (x86)\openvibe\share\openvibe\scenarios\box-tutorials\matlab')); into matlab but it didn't change anything.

I would like to visualize what i have done:

Notwithstanding the original scenario, i think scenario shown in "Matlab scripting box inside"picture would be sufficient to visualize what i plan.

You can see the what is inside of the script described in Scripting box in "Scripts fed into Matlab scripting box" picture.
required mat file is in the same directory specified in Scripting box.

In conclusion, when i write "whos" in the Command window(popped) i cannot see variables in my .mat file.

Hope the problem is clear now.
Any suggestions?


Attachments:
File comment: Command window popped while i hit run
popped Command window.PNG
popped Command window.PNG [ 69.69 KiB | Viewed 574 times ]
File comment: Scripts fed into Matlab scripting box
scripts.PNG
scripts.PNG [ 101.42 KiB | Viewed 574 times ]
File comment: Matlab scripting box inside
matlab scripting inside.PNG
matlab scripting inside.PNG [ 148.28 KiB | Viewed 574 times ]


Last edited by hkn1304 on Mon May 22, 2017 9:18 am, edited 1 time in total.
Top
 Profile  
Reply with quote  
PostPosted: Mon May 22, 2017 9:13 am 
Offline

Joined: Tue Dec 04, 2012 3:53 pm
Posts: 599
Location: INRIA Rennes, FRANCE
I'm not quite sure, I can't check right now, but providing the full path shouldn't do harm (unless you plan to move your experiment somewhere else).

Regarding breakpoints, this should help,

https://fr.mathworks.com/help/matlab/ref/dbstop.html

Maybe you can even write the dbstop directive to the .m launched if you're not able to type to the console.


Cheers,
Jussi


Top
 Profile  
Reply with quote  
PostPosted: Mon May 22, 2017 9:35 am 
Offline

Joined: Tue Apr 18, 2017 5:44 am
Posts: 13
DEbug commands not available when using Matlab as engine, it says. I 'm stucked,phew.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 23, 2017 7:48 am 
Offline

Joined: Tue Dec 04, 2012 3:53 pm
Posts: 599
Location: INRIA Rennes, FRANCE
Looking at your picture, one thing in general which you should not do is to use anything under Program Files\ as a working directory for OpenViBE, as typically programs have no write access there on Windows.

Regarding paths, I'm not sure addpath() changes paths that load() sees. Maybe -- I don't know! What I meant was rather you'd write something like

load('C:\someplace\blah.mat');


Cheers,
Jussi


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Americanized by Maƫl Soucaze.