09-19-2012 08:37 PM
Greetings,
I am given a waveform and I need to divide the curve so that it consists of three segments, with each segment beginning at one peak value and ending at the next using for loops and arrays. I also need to Combine these in a 2D array and plot the waveforms.
I am stuck on how to do this. I attached my code.
Can someone give me any ideas?
Thanks!
TheLT
Solved! Go to Solution.
09-20-2012 08:16 AM
Just so you know, each row in the 2D array will have to be the same length. Just saying you might have some extra 0s in some of your waveforms when you turn it into a 2D array.
Well, you already have the peak locations. I would use the "Round to Nearest" and then convert to an I32. Now you have a set of array indecies. To get your subarrays, use the Array Subset. The index input should be x[i] adn the length should be x[i+1]-x[i]. I'm using x as the array of indicies of the peaks.
09-20-2012 02:23 PM
crossrulz,
Thanks for the reply and apologies for not getting back sooner. Would the "round to nearest" go in the for loop? Or is this outside?
I'm still kind of confused on what to do here.
Thanks!
Jesse
09-20-2012 02:35 PM - edited 09-20-2012 02:35 PM
I'm picturing something along these lines.
09-20-2012 09:00 PM
crossrulz,
Again sorry for the late reply. Thanks for your help so far. Do you know how to perform a ‘time dilation’ on the output received to that each there is say 100 points instead of 60? Did you ever hear of anything like that? Does that involve a for loop in the orginal for loop?
Thanks!
TheLT
09-20-2012 09:01 PM
Also, please let me know if I need to open a new post or, since it relates to the same code, if it would be appropriate to leave this one open.
Thanks!
TheLT