ismember is not supported for fixed-point conversion
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
I am coverting the floating point to fixed point using Matlab coder
Below is code
function isOut = Verify_ismember_data()
Y = 51;
locs = 4;
isOut = ismember(1:Y,locs); % I tried isOut = all(ismember(Y,locs)) & intersect- this does not help
plot(isOut,'b-x','Linewidth',2);
ismember is not supported for fixed-point conversion.
7 comentarios
Guillaume
el 18 de Mzo. de 2020
I don't see where fixed point is used in your code snippet.
I don't have the fixed-point toolbox and I've never used fixed-point in matlab (but have in other contexts). If ismember doesn't support fixed-point numbers can't you just compare the underlying integer representation with ismember instead. This assumes that the fixed point numbers you want to compare have the same precision of course.
The function doesn't have any inputs and I don't see any fixed point values. If the error is unexpected, make sure you're not shadowing the ismember function.
which ismember -all
% C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\ismember.m Example output, 1st row
Life is Wonderful
el 19 de Mzo. de 2020
Editada: Life is Wonderful
el 20 de Mzo. de 2020
Guillaume
el 19 de Mzo. de 2020
"This is generic or you have some other ideas for converting the Matlab function into C "
If it's matlab automatically converting your double variables to fixed point I can't help you.
However, if it's your own code where you've defined the fixed-point format and variables yourself, then my suggestion is to temporarily convert the fixed-point values to their underlying integer type (a basic cast in C) and to call ismember on the integers.
Life is Wonderful
el 20 de Mzo. de 2020
Editada: Life is Wonderful
el 20 de Mzo. de 2020
Adam Danz
el 20 de Mzo. de 2020
I'm afraid I don't have enough experience with Matlab Coder to be of much assistance here.
Life is Wonderful
el 22 de Mzo. de 2020
Respuestas (0)
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!