I write a inline function.
Code:
%%---------
x=uint8(5);
bit=3;
% clear the bit
bitclr=inline('bitset(x,bit,0)');
c=bitclr(x,bit)
%%---------
But the output seems to be wrong.
Is there any other method to write something like C language's Micro?
And I want the inline function or Macro can be used by sub-function.
Thanks!
BTW, I use Matlab 5.3.
Any suggestions will be appreciated!
Best regards,
Davy
If inline does not return the desired function variables or if the function variables are in the wrong order, you can specify the desired variables explicitly with the inline argument list.
g = inline('sin(alpha*x)','x','alpha')
g =
Inline function:
g(x,alpha) = sin(alpha*x)