ivan00 Posted October 21, 2008 Report Share Posted October 21, 2008 Hi everyone! I am asking for some advice. Think my problem is rather simple, but so is my programming knowledge … I have an array of velocity samples and all I want to do is to build a new array containing the values of delta velocity between consecutive data points. Could someone explain how to do this? (for loop? indexing array? … ) I attached a screen shot of the sequence with some explanations. Quote Link to comment
jcarmody Posted October 21, 2008 Report Share Posted October 21, 2008 QUOTE (ivan00 @ Oct 20 2008, 01:17 AM) I want to do is to build a new array containing the values of delta velocity between consecutive data points. Is this what you're looking for? The first loop is just to make an array of data to play with. The second loop indexes through the first array and uses a shift register to make the n-1 element available to each iteration. "n-1" doesn't make sense for the first element in the array so I initialized the Shift Register with the first element of the array, making the first time through the loop result in zero; seemed like the right thing to do http://lavag.org/old_files/monthly_10_2008/post-7534-1224496217.png' target="_blank"> Jim PS - if you post your code as a png file you'll make it easier for us to see. My first thought was that I shouldn't open the Word doc because it could have a virus. I hope it wasn't a mistake... Quote Link to comment
ivan00 Posted October 21, 2008 Author Report Share Posted October 21, 2008 @ jcarmody thanks for your reply !!!! will try to make this change and ... no worries word.doc is clean next time I'll insert pic as png cheers, ivan Quote Link to comment
ivan00 Posted October 21, 2008 Author Report Share Posted October 21, 2008 @ jcarmody hi ! It seems to work fine BIG THANK YOU How can I configure the shift register to get rid of the initial value. Know you mentioned it in your post, but don't know how to actually do this Regards, Ivan Quote Link to comment
jcarmody Posted October 21, 2008 Report Share Posted October 21, 2008 QUOTE (ivan00 @ Oct 20 2008, 08:07 AM) How can I configure the shift register to get rid of the initial value. Know you mentioned it in your post, but don't know how to actually do this Delete the Index Array function and wire a zero to the shift register. The first element in the output array will be the first element of the input array (minus zero). Jim http://lavag.org/old_files/monthly_10_2008/post-7534-1224507877.png' target="_blank"> PS - You're welcome; this stuff is fun for me! Quote Link to comment
Anders Björk Posted October 21, 2008 Report Share Posted October 21, 2008 QUOTE (ivan00 @ Oct 20 2008, 02:07 PM) @ jcarmody hi ! It seems to work fine BIG THANK YOU How can I configure the shift register to get rid of the initial value. Know you mentioned it in your post, but don't know how to actually do this http://lavag.org/old_files/monthly_10_2008/post-13671-1224504362.png' target="_blank"> Regards, Ivan How about putting a minus on the wire before your graf and wire the inital value on the lower connector... 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.