ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2^nextpow2()

Hi All, 

I am using the function 2^nextpow2(L) in Matlab and now I need to use it in Labview as well. could any of you tell me how to do like this function in Labview?

 

many thanks

Thoalfukar

0 Kudos
Message 1 of 4
(5,117 Views)

I'm not familiar with Matlab.  Can you tell us what that function actually does in mathematical terms?

 

Look on the mathematics palette and I bet you can find the functions there you would need to recreate it.

0 Kudos
Message 2 of 4
(5,112 Views)

I don't believe there is any function like this in LabVIEW, but there are a ton of toolkits and one of them might have it. You can quickly google finding the next power of 2 and many algorithms will show up. Implement the one of your choice in LabVIEW.

 

NextPow2.png

0 Kudos
Message 3 of 4
(5,107 Views)

It is not clear from Mathworks documentation what should happen with values -1 to 1. If it should give 1, then replace epsilon constant with 1. 

2^nextPow2(x)

0 Kudos
Message 4 of 4
(5,094 Views)