The MATLAB support package for Raspberry Pi and the Simulink support package for Raspberry Pi require a hardware setup before the hardware can be used with MATLAB or Simulink.
During the hardware setup, upon sucessful completion of the setup, the credentials of the hardware (IP Address, Username and Password) are stored in MATLAB preference for use in future sessions.
The above mentioned error indicates a probable skip of the hardware setup.
If you have not performed the hardware setup, kindly perform it before proceeding with using Raspberry Pi with MATLAB or Simulink. You can refer the following video for assistance with the steps involved in hardware setup.
In case you have already performed the hardware setup, during the creation of the raspi object, pass the credentials
>> r = raspi(<IP address>,<Username>, <Password>)