Hi guys I'm new to MATLAB but now i need to use it for my study. I've tried to learn by myself to run it but unfortunately it failed, so I need some guidance on how to run following time step function in MATLAB(adsbygoogle = window.adsbygoogle || []).push({});

S_{t}= S_{t-1}+ P_{t}- ET_{t}, S_{t-1}+ P_{t}- ET_{t}≤ S_{max}

= S_{max}, S_{t-1}+ P_{t}- ET_{t}> S_{max}

then

R_{t}= 0, S_{t-1}+ P_{t}- ET_{t}≤ S_{max}

= P_{t}- (S_{max}- S_{t-1}) - ET_{t}, S_{t-1}+ P_{t}- ET_{t}> S_{max}

P_{t}= rainfall depth

ET_{t}= evapotranspiration rate

S = Retained rainwater depth in substrate

S_{max}= maximum retention capacity

R = runoff

it is a hourly time step function, hourly rainfall data for a year will be inserted to the function

i would be really appreciated if anyone could help me.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Help: MATLAB time step function

**Physics Forums | Science Articles, Homework Help, Discussion**