Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

help for the algorithm

Status
Not open for further replies.

kingh12

New Member
I have a matrix shown below. And I scan all ( :,1) within a "for" loop. What I want to do is, if the loop finds 3 same number in succession (for example 8 in (7,1), 8 in (8,1) and 8 in (9,1) ) take their datas on their 4th column and put these 3 datas to the function I made. If the loop finds 4 same number in succesion to the same thing again. There is no problem until here. I have 2 "if" loops in my "for" loop. One for 3-group and one for 4-group.

The problem is when the loop finds 4 same number in succession (like 12.0000 in the first column) and do the rest of things for the function, it continues with the next row as usual. And then on the next row (value= 16.0000) it sees that on the last 3 rows, there are 3 same numbers again. It takes the the same datas again with in 3-group and try to process it. I don't want that. I don't want to access to 3 same number in 4th-group same number. I wrote that too long but it looks very simple to correct it. Does anyone know how to fix it?

Thanks...

e4d5.jpg


If the photo doesn't appear, the link is
https://imageshack.us/photo/my-images/43/e4d5.jpg/
 
Status
Not open for further replies.

Latest threads

Back
Top