Start index for ns_GetAnalogData

View previous topic View next topic Go down

Start index for ns_GetAnalogData

Post  joscha.schmiedt on Thu Aug 12, 2010 5:51 am

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

View user profile

Back to top Go down

Re: Start index for ns_GetAnalogData

Post  Jens on Thu Aug 12, 2010 8:14 pm

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-05
Location : Multi Channel Systems

View user profile http://www.multichannelsystems.com

Back to top Go down

Thanks

Post  joscha.schmiedt on Fri Aug 13, 2010 5:54 am

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

View user profile

Back to top Go down

Re: Start index for ns_GetAnalogData

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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