ismember is not supported for fixed-point conversion
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
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 Kommentare
Guillaume
am 18 Mär. 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
am 19 Mär. 2020
Bearbeitet: Life is Wonderful
am 20 Mär. 2020
Guillaume
am 19 Mär. 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
am 20 Mär. 2020
Bearbeitet: Life is Wonderful
am 20 Mär. 2020
Adam Danz
am 20 Mär. 2020
I'm afraid I don't have enough experience with Matlab Coder to be of much assistance here.
Life is Wonderful
am 22 Mär. 2020
Antworten (0)
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!