BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code

To get the distance between two complex points, we can do it the hard way (image) or the easy way (insert).

 

 

(spotted here)

Message Edited by altenbach on 03-12-2009 10:22 AM
Message 421 of 2,635
(13,117 Views)

In this thread, the poster uses split array to break a 1-D array into 2 parts at some index value, then puts it back together again.  Then jams it all into a cluster with some odd numerics that is somehow supposed to connect with a waveform graph.

http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=395848#M395848

 

Message 422 of 2,635
(13,008 Views)

In this post we find that we have to use a great big 2D array to use a searching mechanism in order to convert an hour:minute string to a simple index.

 

 

Message Edited by smercurio_fc on 03-20-2009 09:25 AM
Message 423 of 2,635
(12,980 Views)

A small Rube Goldberg..   From http://forums.ni.com/ni/board/message?board.id=170&thread.id=397135

 

 

Message Edited by Ray.R on 03-25-2009 01:12 PM
Message 424 of 2,635
(12,901 Views)

The polynomial fit outputs an array of polynomial coefficients, that can be used to calculate the function for a random set of x values.

 

Uses stuck in ancient text based code mindsets would of course immediately gravitate to the formula node (with typos):

 

 

 

Prould dataflow pupils would of course translate it literally to wires and primitives.

 

 

The problem with both solutions is scaleability. Whenever the poly order changes, the code needs to be rewritten from scratch. It will also get a bit ugly for e.g. a 12th order polynomial. 😄

 

Of course one would think that the geniuses at NI would have come up with a tool that streamlines this often used task, and in fact there is the "polynomial evaluation" . Fully scalable. It automatically adapts to any polynomial order. Use it!

 

 

(spotted here)

Message Edited by altenbach on 04-07-2009 09:13 AM
Download All
Message 425 of 2,635
(12,782 Views)

altenbach wrote:

The polynomial fit outputs an array of polynomial coefficients, that can be used to calculate the function for a random set of x values.

 

Uses stuck in ancient text based code mindsets would of course immediately gravitate to the formula node (with typos):

 

 

 

Prould dataflow pupils would of course translate it literally to wires and primitives.

 

 

The problem with both solutions is scaleability. Whenever the poly order changes, the code needs to be rewritten from scratch. It will also get a bit ugly for e.g. a 12th order polynomial. 😄


In my defense, I had a very good reason for actually implementing it this way. Obviously the Polynomial Evaluation VI is the ultimate solution, but that wasn't the point of the code. This "interim" implementation was for demonstration in explaining the polymorphic nature of the numeric functions. Scalability or use of a nice built-in function was not what I was trying to show.  Smiley Wink

 

 

Message 426 of 2,635
(12,807 Views)

Hi Altenbach!

can i quote your post with the pictures?

very clear to make a point about LV!

Thanks!

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 427 of 2,635
(12,780 Views)

Gabi1 wrote:

can i quote your post with the pictures?


 

 (Sure, just transfer $1000 to my paypal account first....Just kidding!)

 

Of course, you are free to quote anything posted here, but please include a link to the original location for reference to keep the universe in balance. 🙂

Message 428 of 2,635
(12,771 Views)

actually this is for a workshop i intend to give tomorow on related subjects. will reference!

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
Message 429 of 2,635
(12,766 Views)

I know we don't like sequences, but...

 

If you're going to use a sequence, then use a sequence.

 

I think this structure was used to reduce the amount of space used (it could have been done in one line).

 

 Case Sequence

 

     Rob

Message Edited by Robert Cole on 04-08-2009 09:57 AM
Message 430 of 2,635
(12,713 Views)