Question: ( b ) [ 1 0 pts . ] Write a Matlab / python code to solve the linear least squares problem. Use (
b pts Write a Matlabpython code to solve the linear least squares problem. Use mathrmfibmathrm~m fibpy to generate the true resistances Ri and Rm the voltage inputs f and the corresponding potentials. Add random noise to the computed potentials to generate the potential measurements using
noiselevel ;
error randnn; errorerrornormerror;
xexp xnoiselevelerror;
Then set up the linear least squares problem and solve it using the Matlab backslash backslash command to solve the least squares problem.
Print the 'true' resistances that were used to generate the measurements as well as the recovered resistances obtained by solving the linear least squares problem.
Your code should be written for an N compartment model with arbitrary number of compartments, however, when generating an output please choose a value for N All output must be organized into a labeled table this can be Matlab generated or handwritten For example, if you choose N then your output should look like the following. Note the Xs are where your output would be
input the number of compartments, N:
noise level e
true axial resistance XXXXX
true membrane resistance XXXXXX
recovered axial resistance XXXXXXX
recovered membrane resistance XXXXXX
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
