can someone help me writing the matlab code for this arduino program ? Please

now what should i post and where ?

It sounds like you should be posting an offer to pay someone to write code for you, in Gigs and collaboration. Here, we're willing to help you understand the issues well enough to write the code yourself. But, it sounds like you have no clue about matlab and no interest in getting such a clue.