Question

In matlab, us the pseudo inverse function to create a linear fit from velocity-second matrix. Use...

In matlab, us the pseudo inverse function to create a linear fit from velocity-second matrix. Use the equation to project the speed when v=12 m/s.

v [6 8 10]
s [50 88 124]

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Script file:

clear all;
clc;
n=1;
% n=order of polynomial
% given data
v=[6 8 10];
s=[50 88 124];
% after linearising
% v = a(1) + a(2)*s
X=v;
Y=s;
m=length(X);
if size(X)~=size(Y)
    error('Enter X and Y in same order');
end
A=zeros(n+1,n+1);
B=zeros(n+1,1);
for i=0:n
   for j=0:n
      A(i+1,j+1)=sum(X.^(i+j));
      B(i+1)=sum((X.^(i)).*Y);
   end
end
a=A\B;
fprintf('The polynomial equation is \ns=');
fprintf('%f+%f*v\n',a(1),a(2));
fprintf('At v=12, s=%f',a(1)+a(2)*12);

Screenshot:

1 clear all; 2 clc; 3 n=1; 4% n=order of polynomial 5% given data 6 v=[6 8 10]; 7 S=[50 88 124]; 8% after linearising 9% v =

Save the above program and execute it.

Result:

The polynomial equation is S=-60.666667+18.500000*v At v=12, s=161.333333

I hope this will help you.

Add a comment
Know the answer?
Add Answer to:
In matlab, us the pseudo inverse function to create a linear fit from velocity-second matrix. Use...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT