arduino and matlab

can anybody help me with my code?

I'm having problems for sending and receiving data from the sensors. Something in my code is wrong.

arduino_lab4.ino (2.41 KB)

After reading the "How to use this forum" post, please edit your post to include the code, using code tags, describe what the program should do, and what it does instead.

Post links to the sensors and append a hand drawn wiring diagram.