So I am assuming this is right after MATLAB Support package for Raspberry Pi Setup. If it fails, I usually try the following -
1) Plug in a headphone/earphone on Pi's jack and listen to IP address.
2) Ping IP adress from MATLAB.
3) If step 2 is success, then I type r = raspi('<Insert Pi's IP address>','<Insert Pi's User name>','Insert Pi's password')
Default username of Pi from MATLAB Support package is pi
Default password is raspberry