I am currently writing a piece of software that will calculate solar radiation on a vertical plane. I currently have a 1x49 array, containing values for my incident angle, however some of these values are greater than 90, and i wish to minus 180 from them. How do i go about doing that? I have attached my code below.
angleIncidence = acosd((sind(angleDeclin).*sind(lat - tilt))+(cosd(angleDeclin).*cosd(lat-tilt).*cosd(w)));
if angleIncidence > 90
angleIncidence = 180 - angleIncidence;
end
I have also tried:
angleIncidence(angleIncidence > 90) = 180 - angleIncidence

 채택된 답변

Walter Roberson
Walter Roberson 2020년 4월 14일
mask = angleIncidence > 90;
angleIncidence(mask) = 180 - angleIncidence(mask);

카테고리

도움말 센터 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

질문:

2020년 4월 14일

답변:

2020년 4월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by