LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data extraction from an array of data

Solved!
Go to solution

So I want to extract a subset from an array of data. 

 

I have two columns of data that I need to do with, these are potential energy (expressed in terms of kT) and relative separation.  The data typically results in a parabola-type shape with the potential energy on the y-axis and the separation on the x-axis.  The potential energy starts at high kT's at small separation and then decreases to zero as the separation increases and then it starts to increase again once it is past zero kT.  The issue I have is that I need to disregard any data that is greater than 6 kT.  Thus I need to extract the data (both the potential energy data and the corresponding separation data) from the array that is 6kT or below.  So the problem I am having is trying to work out how to approach the extraction of this data.  I would love to get some suggestion as to how I should approach it.

 

I initially thought of using a mathscript node to do this, but I am not sure of how I should code this, if this is indeed possible.

 

Another option I considered was to use one of the array vi's to perform this extraction as I thought I could use them to find the element where the kT is higher than 6 and the corresponding index element which I could then use to extract the relevant portions of the array.  But I don't see an easy way to achieve this.

 

So the vi I will write for this will function will actually be a subvi of another vi I have written (this vi is named ‘non-linear fit to PE data mod.vi' and it also has a couple of other subvis).  I have attached this vi and a relevant data file (as an example of the data I will be getting and needing to analyse) in a zip file.  I haven't included an example of the subvi I need to write because I looking to find some pointers as to how I could do this first.  In the ‘non-linear fit to PE data mod.vi' I have included a text box in the location I will be putting this subvi.

 

Any help in helping me out here would be appreciated.

 

 

Thanks

0 Kudos
Message 1 of 17
(4,687 Views)
Try the attached VI. as per my understanding you want to remove the data in the array which is grater than the specified value,am right?
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 2 of 17
(4,680 Views)

Yes that is my intention.  I will give this ago.  I didn't even think to use a shift register here.

 

 

Thanks

 

0 Kudos
Message 3 of 17
(4,678 Views)

Is your problem solved? If so please mark the post (Whichever you think is the best solution for your query). This will help others facing same problem and looking for a solution.

Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 4 of 17
(4,675 Views)
Not quite.  I say that purely because I am trying to work out how to include it (as a subvi) into my main vi given that in the main vi I have split up the original data array into two columns (ie x and y) and I need to be able to reconcile the elements at which the PE is over kT (in that array) to the appropriate separation element (in its repsective array.  But this does give me some pointers as to what I can possibly do.

0 Kudos
Message 5 of 17
(4,669 Views)
GO head and check the perfect place to place the subVI which removes the value which is greater than the limits.If you want pointers then get the Index values from the array max and min.
Message Edited by Baji on 07-28-2009 02:23 PM
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 6 of 17
(4,642 Views)
Thanks the pointers Baji.  WIll let you know how it goes when I get to modifying it.  Haven't had a change to properly modify it yet as I have been working on some other stuff (including modifying another vi).
0 Kudos
Message 7 of 17
(4,637 Views)
try this
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 8 of 17
(4,632 Views)
Thanks for that.  I will give this a try.
0 Kudos
Message 9 of 17
(4,627 Views)

Below is a picture of two different ways to do this.  Both of them give you the data less than the max, rather than giving you the indices of the data that is greater than the max.  I'm not sure if this is what you were looking for or not though.

 

untitled.JPG

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 10 of 17
(4,604 Views)