# Exponent character

## Recommended Posts

In Labview 6.1, I've been trying to enter an exponential function into a string and cannot figure out which character to use to denote the exponent (I've already tried the ^ key but to no avail). I know Labview has a method for handling exponents, but the program that I wrote calls for a function in a string.

So you put "3^2" in a string for example and then what are you trying to do with that string? How are you processing it?

Or are you saying you would like the 2 to appear as a superscript?

LabVIEW's math functions that handle exponential operations are located in the Numeric Palette.

Block Diagram > Functions > Numeric > Logarithmic > Power of X

That function "Computes x raised to the y power (x^y)". It uses numerics as arguments, not strings, so if you wanted to use a string that read "3^2" and compute the value, you would need to convert the values to numerics and perform the Power of X function.

In Labview 6.1, I've been trying to enter an exponential function into a string and cannot figure out which character to use to denote the exponent (I've already tried the ^ key but to no avail).  I know Labview has a method for handling exponents, but the program that I wrote calls for a function in a string.

5254[/snapback]

Just enter it the same way LabVIEW displays it in a numeric.

If I understand what you're asking, it's easily demonstrated by wiring a string control to the Fract/Exp String to number function and looking at the output.

1.234e2 ( or 1.234E2) results in a numeric value of 123.4

Barrie

I believe the "E" would be what you were looking for then.... that makes a bit more sense of your previous statements.

So you put "3^2" in a string for example and then what are you trying to do with that string?  How are you processing it?

Or are you saying you would like the 2 to appear as a superscript?

LabVIEW's math functions that handle exponential operations are located in the Numeric Palette.

Block Diagram > Functions > Numeric > Logarithmic > Power of X

That function "Computes x raised to the y power (x^y)".  It uses numerics as arguments, not strings, so if you wanted to use a string that read "3^2" and compute the value, you would need to convert the values to numerics and perform the Power of X function.

5256[/snapback]

Well, the problem with using the built-in exponent method is that I can only evaluate a single exponential expression, such as 3^2 and 4^5. Instead, I want be able to input an exponential expression with a variable, such as (1.5)*(2)^x, and use the evaluate y=f(x) function (Block Diagram > Functions > Mathematics > 1D and 2D Evaluation > Eval y=f(x).vi) to generate an array of doubles from an inputed set of bounds. I thought of using separate loops to generate the array using the Power of X operation instead of the Eval y=f(x), but it would be in discord with my hierarchy and variable placement. I tried to minimize my code by placing functions and variables outside of my control structures, but I guess this has screwed up the functionality :headbang:.

Just enter it the same way LabVIEW displays it in a numeric.

If I understand what you're asking, it's easily demonstrated by wiring a string control to the Fract/Exp String to number function and looking at the output.

1.234e2 ( or 1.234E2) results in a numeric value of 123.4

Barrie

5257[/snapback]

Sorry for the confusion in my first post, but I want to input an exponential function, such as (.34)*(9.6)^x, rather than a number in scientific notation, and have it recognized by the Eval y=f(x) method found in

Block Diagram > Functions > Mathematics > 1D and 2D Evaluation > Eval y=f(x).vi

I finally found what you were talking about and tested it out. I put in a formula of y=x^3 and set input value x=2 -> Output = 8. Then I switched the formula to y=3^x -> Output = 9. So it looks like it works just fine to do what you want it to do, which is probably an upgrade that was included after LabVIEW version 6.1 since I'm assuming you did something identical and it doesn't work right for you.

I finally found what you were talking about and tested it out.  I put in a formula of y=x^3 and set input value x=2 -> Output = 8.  Then I switched the formula to y=3^x -> Output = 9.  So it looks like it works just fine to do what you want it to do, which is probably an upgrade that was included after LabVIEW version 6.1 since I'm assuming you did something identical and it doesn't work right for you.

5278[/snapback]

VEERRRY interesting... I tried it again and it worked! Silly me, trix are for kids! Thanks for the help, even if it was just showing me it worked.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account. ×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×