Question

1.)We frequently perform the operation of finding amplitude and
phase of a complex
number. Create a MATLAB function that transforms the complex number
to amplitude and phase. The
function definition and first few lines of the help comments are
shown below.
function [amp,phase] = rect2polar_xxx(z,ifdeg)
% function [amp,phase] = rect2polar_xxx(z,ifdeg)
% The function converts a complex value, z, to polar form,
returning
% amplitude (amp) and phase (phase)
% The calling parameter ifdeg controls whether the phase is
in
% degrees or radians
%... (you fill in)

2.)
First, create function[a,b]=linear_ls_xxx(x,y) as defined below.
Note that
this is a strictly linear operation, any log or semilog processing
is done before the function is called.
function[a,b]=linear_ls_xxx(x,y)
%function[a,b]=linear_ls_xxx(x,y)
% This function creates a linear least-squares estimate of
the
% slope (a) and y-intercept (b) given a set of input data
(x,y).
% The form of the estimate is y_hat = a*x +b, where y_hat is
the
% least-squares estimate of y
% Calling parameters
%... (you fill in)
% Returned parameters
%... (you fill in)