LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenating arrays

Store a 2X2 array of strings instead of getting a array of characters.  what I am getting is a string of characters (i.e. For the name Matt I am getting following 1x6 array 77 97 116 116).  Is there a way to get a 1x1 array and a string output rather then a char output?  
Download All
0 Kudos
Message 1 of 17
(3,357 Views)

Could you post an image of your VI (.PNG format)?  I don't have 8.6 here, but it doesn't sound like what you are doing is hard.

 

Thanks.

 

-Matt

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 2 of 17
(3,344 Views)

Wow, that's LabVIEW... but almost not really a LabVIEW question.

If you really want to manipulate your strings using MathScript nodes, you may need to mention 'using MathScript' in your subject.

 

Someone who has a bit of experience using MathScript nodes or MATLAB may be able to help you with your chosen method.

 

This is how I'd read a spreadsheet, sort it, then write it back again...

example read write string 

Message Edited by Troy K on 04-27-2009 09:59 AM
Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 3 of 17
(3,337 Views)
Here is picture of my code and also the mathscript code I have attached
Download All
0 Kudos
Message 4 of 17
(3,311 Views)

I agree with troy that mathscript is probably the wrong tool for all this. Can you explain what the VI is actually supposed to do?

 

 

0 Kudos
Message 5 of 17
(3,263 Views)
I am trying to sort names of people for a race that is determined by their  qualifying time.  So simply sorting them from largest to smallest or vice versa will not be enough, so by using Mathscript I was able to sort the names in various different ways.  Is there way without mathscript? 
0 Kudos
Message 6 of 17
(3,256 Views)

I am not going to dissect your mathscript code, so please be a bit more specific in your specification.

 

What is the input?

What is the desired output?

 

Your file has two columns, a name and a number.


leaf34 wrote: 
Is there way without mathscript? 

Of course! I suspect all you probably need is some graphical code the size of a postage stamp. 😉

Message 7 of 17
(3,251 Views)
What I am trying to do is to sort players with their corresponding times, the first column is are the [players names while the second row are their times.  The matscript code places the player with the highest time against the player with the lowest time, and then is places the player with the second lowest time against the player with the second highest time and so forth.  I am not having trouble with this part.  The trouble I am having is that I input a 10x2 matrix and I want a 5x2 output (first row and column being the player with the lowest score and the row 1 and column 2 being the player with the highest score).  Instead of getting a 5x2 matrix I am getting a 5x12 matrix.  This is because the name Andrew, for example, takes up a 6 columns a column for each letter.  I believe this because when mathscript reads a string it converts the name in to char (each letter is converted into a number). Is there any way to concatenate the columns in mathscript or outside the mathscript node so the name Andrew takes up only one cell?       
0 Kudos
Message 8 of 17
(3,235 Views)

You could set them up as an array of clusters and then use the LabVIEW sort function -- it will sort based on the first element of the cluster, so you would need to build two different arrays of clusters (one with the name first, the other with the time first).

 

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 9 of 17
(3,213 Views)

leaf34,

 

It sounds like you are trying to create a tournament bracket?  Is this the kind of output you are looking for?

 

 

Message Edited by Wayne.C on 04-27-2009 03:53 PM
Message 10 of 17
(3,193 Views)