Skip to main content
1-Visitor
May 17, 2016
Solved

Filter out out NaN and Complex results?

  • May 17, 2016
  • 4 replies
  • 4781 views

In the attached worksheet there is a plot error (Plotting failed. Replace complex values and NaN by real numbers.) I've tried using failterNaN to remove the NaNs. Is there a way to remove the complex results?

Best answer by Fred_Kohlhepp

I can't open your sheet, only see the jpg's.

In Filter 1 you define ORIGIN:=0 (that's default any way.)

In Filter 2 you have

so the first element of xv is not defined, 0 by default, but no units.

I don't see where you define x, but:

suggests that x has no units--you put in feet and Mathcad divided by meters to balance the units.

I think that's your basic problem.

4 replies

23-Emerald I
May 17, 2016

I can't open your sheet, only see the jpg's.

In Filter 1 you define ORIGIN:=0 (that's default any way.)

In Filter 2 you have

so the first element of xv is not defined, 0 by default, but no units.

I don't see where you define x, but:

suggests that x has no units--you put in feet and Mathcad divided by meters to balance the units.

I think that's your basic problem.

24-Ruby III
May 18, 2016

Fred,

Please find PDF document of this worksheet in attachment.

23-Emerald I
May 18, 2016

Thanks!  It's interesting to see the entire sheet..

25-Diamond I
May 17, 2016

filterNaN does not work the way you use it and would not help anyway.

A 2D plot will only fail with that error if ALL values are NaN or invalid and I suspect that the latter is the case.

I can't read P3.1 and I could not be bothered to switch between three JPGs to debug.

But I would suggest you try to evaluate your function V for a simple single value.

What happens if you type V(2 ft)= ? Where does the error trace to?

EDIT: Fred could possible be right (again). Try to define a range variable for x, like x:=1ft, 1ft+1in .. 10 ft or whatever seems appropriate.

25-Diamond I
May 17, 2016

Just remote connected to a machine with P31 and can confirm, that Fred is right.

21-Topaz II
May 18, 2016

filternan.jpg

dsochor1-VisitorAuthor
1-Visitor
May 18, 2016

Thank you all very much, the issue was that x was not defined.