How to determine repeated value in row of an array
Mostra commenti meno recenti
I have a data of
1 1 2 2
2 2 3 1.5
3 3 4 2.2
4 4 5 6.8
5 4 6 1
6 5 7 5.1
7 6 8 2.5
8 7 9 3.3
9 8 10 2.8
10 8 11 1.4
11 10 12 3.2
12 11 13 2.7
13 12 14 1.9
14 13 15 4.5
How can i create a code to have it to check on each row if the value is repeated.
As an example:
The value that i wanted to check is on row 4 column row 2 and 3.
The value selected is 4 and 5. These value are then being compared with the value of the row below it.
If the value in the following row which is row 5 have value that are same with the value above which is 4, it will continue this comapring process with the value 4 and 6 with another row until there is no other identical appear.
After identifying all repeative value, the value in column 4 of those repeative value are being added together.
4 Commenti
KALYAN ACHARJYA
il 14 Dic 2020
Sorry, I read the question 2 times, unable to get exact logic, can you simplify more? A short example always helps to understand quickl
Chau Chin Haw
il 14 Dic 2020
Ive J
il 14 Dic 2020
Can you provide an example along with algorithm steps? For instance:
% Step 1
A = [1 1 2 2;
3 2 1 4];
% step 2
% what to do
% step N
Chau Chin Haw
il 15 Dic 2020
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Matrices and Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!