Start index for ns_GetAnalogData
2 posters
Page 1 of 1
Start index for ns_GetAnalogData
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);
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
Re: Start index for ns_GetAnalogData
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
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
Thanks
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
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|