Besides the calculations and processing MATLAB is able to do, it has the capability to send and receive data over the network. A socket could be established at each process to send and receive data over the network. 

The learners are asked to work individually to write a client-and-server program. The client is who going to establish a connection, encode a dataword, and send the encoded codeword over the server. On the other hand, the server will be waiting for the connection, from the client, and will expect the codeword to be received.

At the beginning of the program, the user should choose between being a client or a server.

If the client option has been selected, the program will take the following steps:

1.    Ask for a 4-bit dataword.

2.    Encode the dataword into a 7-bit Hamming code codeword (should be printed on the client screen).

3.    Give an option to change a bit in the codeword to create an error. If the error option has been selected, then one bit should be changed before sending (should be printed on the client screen).

4.    Send the codeword using UDP to the server

In the other side of the connection, the server is waiting for the codeword to be sent from the client. Upon arrival of the codeword, the server will 

1-   Print the received codeword

2-   Decode the codeword

3-   Print a message whether the codeword is correct or not

4-   Correct the error if there is one, and print the corrected codeword 5- Extract and print the dataword.

The code should operate and be terminated properly. The code should be re-run without having to restart MATLAB. MATLAB UDP connection Basics:

Both sides (client and server) should create and connect a UDP object to the network. Then the client should send data and the server read the sent data.

1.    Create a UDP Object: by using matrix udp command. The command will include the remote host IP address, Port number, and local port number. 

 u1 = udp(‘192.168.93.12’, 8866, ‘LocalPort’, 8844)

where u1 is the UDP object name, ‘192.168.93.12’ is the remote host IP address, 8866 is the port number of the process at the remote host, and finally

” ‘LocalPort’, 8844 ” represent the local port number for the current process.

2.    Connect the UDP object to the interface: use fopen command.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"