ismember is not supported for fixed-point conversion
Info
This question is closed. Reopen it to edit or answer.
Show older comments
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 Comments
Guillaume
on 18 Mar 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
on 19 Mar 2020
Edited: Life is Wonderful
on 20 Mar 2020
Guillaume
on 19 Mar 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
on 20 Mar 2020
Edited: Life is Wonderful
on 20 Mar 2020
Adam Danz
on 20 Mar 2020
I'm afraid I don't have enough experience with Matlab Coder to be of much assistance here.
Life is Wonderful
on 22 Mar 2020
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!