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