Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Replace based on conditions, What is wrong in my code ?

조회 수: 4 (최근 30일)
nlm
nlm 2019년 2월 11일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi,
Can anyone else me what is wrong in this line of code,
Tried this :
for ii = 1: size(data,1)
data(ii).count = zeros(406,964);
end
and this:
for ii = 1: size(data,1)
data(ii).count = zeros(391384,1);
end
for ii = 1:length(data)
for kk = 1:length(data(ii).value)
data(ii).count((data(ii).EASEC_IMG(:)==data(ii).EASEC(kk)) & (data(ii).EASER_IMG(:)==data(ii).EASER(kk)),1)= data(ii).value(kk);
end
end
My data is in struture "data". I want to replace the zeros in data.count which is (391384,1) by values in data.value which varies with "ii", if the vectors in data.EASEC_IMG match data.EASEC and data.EASER_IMG matches data.EASER.
My EASEC_IMG and EASER_IMG are also (391384,1).
It works only for ii =1, after which it seems to give no answer (I checked through other means).
Any help is appreciated
  댓글 수: 1
Jan
Jan 2019년 2월 12일
We cannot run the code without the input data. You forgot to mention, why you expect that there is a problem. In consequence we cannot guess, what the problem is.

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by