This leads to minc ||Ac − y||, Now for n = 10, xj = 1 + (j − 1)/(n − 1) and yj = e xj , find c1, c2 and c3. Solve problem by using matlab.
Show older comments

3 Comments
Walter Roberson
on 8 Feb 2022
What is your question?
Chun Kit NG
on 8 Feb 2022
Jan
on 8 Feb 2022
@Chun Kit NG: This is the question of your homework. But what is your question? The forum will not solve your homework, but if you show your current code and ask a specific question, we assist you to solve it by your own.
Answers (1)
Image Analyst
on 8 Feb 2022
Did you code in the equations it told you to? From the question:
n = 10
x = 1 + (1:10 - 1) / (n-1)
y = exp(..........
and then call polyfit() to fit the quadratic? It's literally just 4 lines of code - including the call to polyfit(). I'm confident you can do it!
4 Comments
Chun Kit NG
on 8 Feb 2022
Image Analyst
on 8 Feb 2022
I already did. Did you read the link I gave?
You literally just need to look up how to call exp() to do e^x, and then look up polyfit to see how you can get the coefficients from x and y. If I do anymore, which is just a few characters (like around 20 or so), and you turn in my code as your own work, then you may get in trouble with your university for cheating, which we would not want to happen. Some universities use plagiarism detectors that look for that kind of thing.
Did you look up exp() and polyfit() in the help? If not, why not?
If you need to learn the basics, then invest 2 hours in this:
and by lunchtime you'll be programming like a pro.
Chun Kit NG
on 9 Feb 2022
format long g
A = magic(5)
b = [7 3 8 2 4].'
c = A\b
A*c - b
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!