Effacer les filtres
Effacer les filtres

How to assign values to a structure based variables recursively.

2 vues (au cours des 30 derniers jours)
Arsal15
Arsal15 le 27 Fév 2016
Modifié(e) : Arsal15 le 27 Fév 2016
I am running a simulation which is random data based so I have every time different data set. It has a structure variable identity which search the id based on the index of a the Identity array.
Like ID = 1 starts the search and find 32,55,71,92,99 and so... then step 1 output IDs start their individual search, like 32 separately, 55 separately,71 separately and so on then I have to assign (data and state = 1)to the intersection of their outputs in step2 and then Step 2 IDs start their search and then I will assign their intersection assign (data and state = 1)to the intersection of their outputs in step3 and then it continue until all random data points have (data and state = 1).
I have done till step 2 but when i assigned (data and state = 1) the loop goes on forever..? Can anyone give simple hint to solve this issue.
if true
for i = numel(random_points)
nid = find(hamming>0 & hamming<50);
for i = 1 : numel(nid)
if (vec(nid(s)).state ==0)
vec(nid(s)).data = 1;
vec(nid(s)).state = 1;
end
end
end
end

Réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by