I've solved the problem. mypi = raspi(ipaddress,username,password) overrides the IP address, user name, and password from the previous connection. Use this syntax to connect to a board whose settings are different from the previous successful connection. After changing the password on a board, use this syntax. Or, after connecting from the MATLAB software to a second Raspberry Pi board, use this syntax.
For first time you can connect by raspi() But from next you execute pi = raspi('169.254.0.4','your username of PI','your password')