8-Gravel
February 24, 2022
Solved
Variable is undefined
- February 24, 2022
- 1 reply
- 1759 views
I am not getting answer what exactly I am doing wrong. Help please!
Jon
Whats the reason for the range? What would you like to achieve?
If the reason is to create a table of values (just for viewing, you can't use that table for anything else unless you use a vector instead of a range), you can't include z=0 because in your formula you divide by z and so you run into a division by zero. You may start the range at 0.1 ft with 0.2 ft as second value in that case.
If you intend to use the range just for plotting Z(z), starting it with zero should be no problem as the error we get for z=0 is simply ignored by the plot.

Of course you could also redefine function Z using try/on error and assign any value, an error message or NaN (Not-a-Number) in case of the original function failing. It all depends on your needs

Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.