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