Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How can resolve r0<=r0_max?

1 Ansicht (letzte 30 Tage)
Alessandro Perna
Alessandro Perna am 5 Okt. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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)

Antworten (1)

Are Mjaavatten
Are Mjaavatten am 12 Nov. 2020
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

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by