How to assign values to a structure based variables recursively.

조회 수: 1 (최근 30일)
Arsal15
Arsal15 2016년 2월 27일
편집: Arsal15 2016년 2월 27일
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에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by