Hi Koloman,
The targets display numbers. Those numbers will change during the experiment. And to display number, I have to manipulate VCODES. And, I have another question, when I try to convert int to str by using int2str in the embedded MATLAB. It says “The function ‘int2str’ is not supported for standalone code generation”. So is there a way to do that?
Thanks,
Jinyang
Hi Jinyang,
You can have up to 499 permanent (also called background) targets with labels to display numbers. You can create a permanent target by adding 100 to VCODE(1) ie. if you want a permanent target circle, it’d VCODE(1) = 101 instead of 1. After that you just need to assign a unique ID in VCODE(8) that is between 1 and 499.
Permanent targets are cached and don’t need to be sent every frame if matrix elements aren’t changing often. This is how they get around data transmission limits that necessitate the limit of 50 on VCODES.
That said, in Dex 3.7 we are lifting the 50 VCODE limit. I think your KINARM might be able to handle more than 50 already as well. If you can email us at our support email, we can verify those details and how to make that happen.
For int2str, a Matlab string is a vector of the ASCII elements. So you should be able to take your number and put the digits in a vector and then add the ASCII offset.
For example, if you have 789, you can use the rem command to isolate the digits and make a vector that is [7 8 9]. ASCII 0 is 48 decimal so add 48 to [7 8 9] to get [55 56 57] and that is the string equivalent to 789.
Cheers,
Koloman
Please login or Register to submit your answer