LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI of the Day (10/26/2009) - Matrix Size


Darren wrote:

Very cool tip...I was not aware of the Matrix Size function.  Perhaps I will steal borrow this tip for a future Darren's Weekly Nugget.  😉

 

I just benchmarked the two approaches, and it looks like Matrix Size is slightly slower than the Array Size -> Index Array approach, but unless you're calculating 2D array sizes in a very tight loop, it shouldn't make enough of a difference to account for the usability and real estate advantages of Matrix Size.

 

-D

 

Edit:  Whoa!  I just discovered that it works for *any* 2D array...it doesn't even have to be Numeric!  This may just be cool enough to be today's nugget.  🙂

Message Edited by Darren on 10-26-2009 01:04 PM

Please feel free to borrow/steal/pilfer as I am having a hard time stopping myself from having a VIOTD on the Implies function.

0 Kudos
Message 11 of 14
(1,258 Views)

Implies!  If this thing is true and this other thing is false, do something.  Otherwise, do something else.  A situation that comes up surprisingly often in LabVIEW.  You should definitely write a Function of the Day post about it... 😉

0 Kudos
Message 12 of 14
(1,253 Views)

Darren wrote:

Implies!  If this thing is true and this other thing is false, do something.  Otherwise, do something else.  A situation that comes up surprisingly often in LabVIEW.  You should definitely write a Function of the Day post about it... 😉


Let me make sure I understand this implies thing:

 

If Title="VIOTD" is True and Misuse in Post is False, get off my case, otherwise, throttle me with my own mouse. 

 

You are right, that does come up fairly often. Smiley Very Happy 

0 Kudos
Message 13 of 14
(1,236 Views)
Alrighty, it's officially today's nugget.  Also, my previous comment about Matrix Size being slightly slower than Array Size appears to be unfounded...upon further benchmarking, it looks like Matrix Size might actually be a lot faster than the Array Size -> Index Array approach, I think because Array Size has to allocate an array for its output.  I'm pretty sure my previous benchmark had some constant folding trickiness that gave me bogus results.
Message 14 of 14
(1,223 Views)