Welcome to our user forum (read only mode).
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Start index for ns_GetAnalogData

2 posters

Go down

Start index for ns_GetAnalogData Empty Start index for ns_GetAnalogData

Post  joscha.schmiedt Thu Aug 12, 2010 6:51 pm

Dear MCS or any other users with advice,

I am currently concerned with the conversion of your MCD data format into our own inhouse data format. For this purpose I am using the Matlab Neuroshare interface (V3.0 with the newest nsMCDLibrary.dll from your website).

However, I ran across a weird phenomenon: ns_GetAnalogData returns the same values for both 0 and 1 as starting index except from the very last value. In addition, it is possible to retreive ItemCount+1 data entries without an error. Then, an extra value is inserted at the index end-1.

I would like to know, what are the correct arguments for ns_GetAnalogData function when I want to retreive all data for an analog entity.

My configuration is: MCRack 4.0.0, Matlab 7.10 (Win 7 32bit)
The files are from a recording with a maximum file size of 3000 MB.

Thanks in advance!

Example:
[nsresult,entity] = ns_GetEntityInfo(hFile,entityID);

[nsresult,count,data0] = ns_GetAnalogData(hFile,entityID,0,entity.ItemCount);
[nsresult,count,data1] = ns_GetAnalogData(hFile,entityID,1,entity.ItemCount);
returns the same except from the last entry

Also possible without error:
[nsresult,count,data0_1] = ns_GetAnalogData(hFile,entityID,0,entity.ItemCount+1);

joscha.schmiedt

Posts : 2
Join date : 2010-08-12

Back to top Go down

Start index for ns_GetAnalogData Empty Re: Start index for ns_GetAnalogData

Post  Jens Fri Aug 13, 2010 9:14 am

Dear Joscha,

please have a look at ns_GetAnalogData.m:
it calls mexprog with StartIndex - 1 to convert between the Matlab convention of starting an index with 1 and the c convention starting an index with 0. So it is rather accidentially that 0 as StartIndex works, it is an invalid value. With StartIndex = 1 entity.ItemCount+1 should be not possible.

Jens

Jens

Posts : 55
Join date : 2009-03-06
Location : Multi Channel Systems

http://www.multichannelsystems.com

Back to top Go down

Start index for ns_GetAnalogData Empty Thanks

Post  joscha.schmiedt Fri Aug 13, 2010 6:54 pm

Ah, yes, could've thought of that. Thank you! Maybe this should be stated somewhere in the documentation or produce a warning.

joscha.schmiedt

Posts : 2
Join date : 2010-08-12

Back to top Go down

Start index for ns_GetAnalogData Empty Re: Start index for ns_GetAnalogData

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum