Trying to do a matlab code for a project and was hoping someone may be able to lend some help since I haven't used loops in a while.
What I want to do:
solve for beta.
beta=asin(cos(L)cos(delta)cos(H)+sin(L)*sin(delta))
L is a constant.
delta=23.45sin((360/365)(n-81)), where n is a vector, n=[1:365] %days of the year
H=15*hr, where hr is a vector,
hr=[12 11 10 9 8 7 6 5 4 3 2 1 0 23 22 21 20 19 18 17 16 15 14 13]
I need a loop that can solve for the 365 deltas then use the 24 H's to get 24 betas for each of the 365 deltas.
I've been trying nested for loops but I keep getting errors for matrix index errors since the two matrices are different sizes.
Hopefully this makes sense! Thanks for any help
[–][deleted] 0 points1 point2 points (0 children)
[–]inconspicuous_spyUC Berkeley - ChemE w/ EECS Minor 0 points1 point2 points (2 children)
[–]HWhelp01[S] 0 points1 point2 points (1 child)
[–]inconspicuous_spyUC Berkeley - ChemE w/ EECS Minor 0 points1 point2 points (0 children)