and you have a result from a different function say y=8
and want to find which numbers of the array have the same highest binary digit with y in the case
above y=[1000] and 2=[0010] 5=[0101] 10=[1010] so the only number in the array which has the same highest binary digit with 8 is 10.
How can i do this in matlab?
1
Expert's answer
2011-06-07T09:28:42-0400
function mx=q2996(y,x) n=floor(log2(y)+1); l=length(x); mx=[]; for k=1:l if floor(log2(x(k))+1)==n mx=[mx x(k)]; end; end;
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment