if condition picking certain day of week
3 views (last 30 days)
I am using a for loop using time as a variable. For day 1 (Monday) there is a value. Then I start a for loop starting from 4th day (Thursday). I want to use for loop only on Day 1(Monday) and Day 4 (Thursday) of every week for 40 weeks. This is related to a situation in radiation treatment where the radiation is given every Monday and Thursday.
I am using following script for 'for loop' which is obviously not true for my above situation. Any help will be appreciated.
syms x t
c2(x) = 2*dirac(x-1);%day 1
for j=4:4:40 %needs some modification
c2(x) = c2(x)+2*dirac(x-j);