How to assign values to a structure based variables recursively.

2 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by