LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I extract the numbers from an array and diplay each one as a number rather than in an array

Hi
 
I am having a mad moment.
 
All I want to do is break my 1d numeric array into seperate numbers so they can be represented as single number numeric indicators.  If I use the delete from array function the number is still represented in an array.
 
Very easy answer I am sure but little things like this drive us crazy.
 
Ash
0 Kudos
Message 1 of 6
(3,264 Views)
 
Sorry!  I was being very stupid - it was because I was wiring to the length on the delete from array function.
 
Fixed now
 
Ash
0 Kudos
Message 2 of 6
(3,259 Views)
Don't use "delete from array", it is not useful for this and very inefficient. Use "index array", it is resizeable. 🙂
 
 
 

Message Edited by altenbach on 06-23-2006 02:23 AM

0 Kudos
Message 3 of 6
(3,261 Views)
Thank you!
 
I then have another question.
 
I am using the extract numbers example vi to get the numerical data back from my comma seperated data string
 
I.e.  sting data:  1,2,3,4,5,6,7 etc..  gives me a numeric array 1,2,3,4,5,6,7 etc. 
 
is this an efficeint way of doing this?
 
Many thanks
 
Ash
0 Kudos
Message 4 of 6
(3,254 Views)
Ash,

The example is pretty efficient, and has the advantage of being fairly flexible if you have an odd format to your string.

Other ways to do it:
1.  If you have a known format (e.g. always 7 numbers separated by commas), you could use the Scan From String function.  This would avoid the need to loop on the string.
2.  You could do something similar to the example, but use the Search/Split String function instead of the Pattern Match function.  This would let you pull out the commas as you travel down the string, and grab the numbers that occur before them.  This is less flexible than the example, but it might be a shade faster.

I'm sure others here have some unwholesomely clever ways of doing this as well.Smiley Wink
Joe Z.
0 Kudos
Message 5 of 6
(3,238 Views)
Hi,


I'm not sure which method the example vi uses, but scanning strings is very slow. You'll only notice this with very large data sets though.


If you want it to be efficient (and if it's possible), use Spreadsheet String To Array. I've seen speed improvements of 1000 times.


Regards,


Wiebe.




"Ashley.w" <x@no.email> wrote in message news:1151055608195-382668@exchange.ni.com...
Thank you!
&nbsp;
I then have another question.
&nbsp;
I am using the extract numbers example vi to get the numerical data back from my comma seperated data string
&nbsp;
I.e.&nbsp; sting data:&nbsp; 1,2,3,4,5,6,7 etc..&nbsp; gives me a numeric array 1,2,3,4,5,6,7 etc.&nbsp;
&nbsp;
is this an efficeint way of doing this?
&nbsp;
Many thanks
&nbsp;
Ash
0 Kudos
Message 6 of 6
(3,226 Views)