Info

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

How can resolve r0<=r0_max?

조회 수: 1 (최근 30일)
Alessandro Perna
Alessandro Perna 2020년 10월 5일
마감: MATLAB Answer Bot 2021년 8월 20일
if r0{mm,nn}(:,1) <= r0_max(mm,nn)
copertura{mm,nn}(:,1) = 1;
else
copertura{mm,nn}(:,1) = 0;
where
r0{mm,nn} = ((SSx{mm,nn}-Px).^2+(SSy{mm,nn}-Py).^2+(SSz{mm,nn}-Pz).^2).^0.5; (cell 181x361 which element are 43x1 or 44x1)
r0_max = (R_E^2-(R_E.*cos(beta0)).^2).^0.5; (matrix 181x361)

답변 (1개)

Are Mjaavatten
Are Mjaavatten 2020년 11월 12일
I interpret your question to mean that you want copertura{mm,nn}(k,1) to take the value 1 if r0{mm,nn}(k,1) <= r0_max(mm,nn), and 0 otherwise. If so, this should do the trick:
copertura = cell(mm_max,nn_max);
for mm = 1:mm_max
for nn = 1:nn_max
copertura{mm,nn}=double(r0{mm,nn}(:,1) <= r0_max(mm,nn));
end
end

Community Treasure Hunt

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

Start Hunting!

Translated by