There is no SSH server running on 192.168.1.2 and the target machine is refusing SSH connection request from MATLAB.
1. Login to your Raspberry Pi using a monitor and keyboard and check that the board has the correct IP address. After logging in to Raspberrry Pi, execute the following in a Linux shell window
$ ifconfig eth0
Verify that the "inet addr" displayed as a result of the command above is "192.168.1.2". If not, you need to modify your /etc/network/interfaces file to assign a static IP address.
2. SSH server is running:
$ps -ef | grep sshd
This should return an sshd server running on your Raspberry Pi if you do not see anything reboot your Raspberry Pi
3. Ping your Raspberry Pi from within MATLAB:
>> ! ping 192.168.1.2
This should be successful.
Report what you are getting.