Please show all the steps of the MATLAB function Write a fu

>> Please show all the steps of the MATLAB function

Write a function nybblise which takes as input digital signal of 0\'s and 1\'s stored in a vector of size N x 1. and breaks it into four 4-bit nybbles, which are returned as the columns of a 4 x N/4 matrix. For example, the 16 bit input should be mapped as di dis dg 13 d2 de 10 14 ds d7 11 15 Lodi ds d d d16 12 16. Your function must return -1 if the N is not a multiple of 4 Following is the signature of the function. function A nybblise (d) Input d digital signal as a vector of size N x 1 output A nybbles as a 4 x N/4 matrix OR 1 if N is not a multiple of 4 Note: This function must use loops rather than MATLAB built-in functions such as reshape, fliplr, flipud. If you do not use loops, you will not receive any marks for the test output, even if test cases pass.

Solution

r1=1;

r2=N;

N=input(\'Enter a number:\');

d=[r2:r1];

if(N%4==0)

A=reshape(d,4,4);

disp(\'the matrix is :\');

else

A=-1;

end;

>> Please show all the steps of the MATLAB function Write a function nybblise which takes as input digital signal of 0\'s and 1\'s stored in a vector of s

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site