ismember is not supported for fixed-point conversion
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
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 件のコメント
Guillaume
2020 年 3 月 18 日
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
2020 年 3 月 19 日
編集済み: Life is Wonderful
2020 年 3 月 20 日
Guillaume
2020 年 3 月 19 日
"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
2020 年 3 月 20 日
編集済み: Life is Wonderful
2020 年 3 月 20 日
Adam Danz
2020 年 3 月 20 日
I'm afraid I don't have enough experience with Matlab Coder to be of much assistance here.
Life is Wonderful
2020 年 3 月 22 日
回答 (0 件)
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!