I am trying to convert a Matlab project into C++ by using Matlab coder. I have few places in my code that I use num2str function. But when trying to build the project using Matlab coder I get the following error.
"The function 'num2str' is not supported for standalone code generation."
I used this function in cases where I needed to create a field identifier for structs.
Eg:
for i=1:numel(bvec)
fId = ['L', num2str(i)];
tmp = mystruct.(fId);
% do some work here
end
Is there an alternative to the function num2str for me to be able to convert the project?
fprintfis supported, with lots of contraints...uniVec(3)will return the unicode value for 3 for example. Also you will have to handle the case of numbers with more than 1 digit in some way.