pesce Posted June 8, 2006 Report Share Posted June 8, 2006 Hallo, I have this problem, I take measure from a machine giving the following input: star vol, stop volt, step size, number of points. What i recive from the machine are two arrays like: (after using built array and turned row to column): //startvolt= 0, stop volt=3, step size=1, number of points= 3// Voltage Current 0 84 1 85 2 86 3 87 0 90 1 91 2 92 3 93 0 100 1 101 2 102 3 103 I want to cut the columns (or the rows as u prefer) when the voltage reach again the starting value and and obtain something like: Voltage current1 current2 current3 0 84 90 100 1 85 91 101 ... ... ... ... I can easily delete from the voltage array the values but for the current i don't know what to do. My idea is to do a for loop where number of loops = number of points, where i put "subset of array" vi giving in input the length (Stop-start)/step, the index is (i * ((stop-start)/step))+1 but I don't know how to collect the subset of array every loop and then put them in different column. Thank you very much pesce Quote Link to comment
didierj Posted June 9, 2006 Report Share Posted June 9, 2006 Try the "decimate array" primitive in the array palette. Quote Link to comment
pesce Posted June 9, 2006 Author Report Share Posted June 9, 2006 Try the "decimate array" primitive in the array palette. I think it can't be a solution bcause the number of column is a variable :question: Quote Link to comment
Mike Ashe Posted June 9, 2006 Report Share Posted June 9, 2006 Look at some of the build and sort array examples in \examples\general folders, like the arrays.llb There is a simple ex: Separate Array Values.vi that you could modify by subindexing the array using the loop counters. You'd probably have to drag one more layer of loop around the example code, but this should get you started. If you get stuck, post your modified version of the VI along with your caller (or a subset saved as a scratchpad VI) and we'll see what we can do. Quote Link to comment
torekp Posted June 14, 2006 Report Share Posted June 14, 2006 Try this. I'm assuming that your array has an integer number of repeats of the same voltages (e.g., 0,1,2,3,0,1,2,3; not 0,1,2,3,0,1,2). Or else that you don't mind the resulting array getting padded with 0's to fill the last column. Labview 8.0, but if you don't have 8 it's easy to reconstruct. Download File:post-4616-1150314694.vi Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.