Solving linear functions with matrix

1 view (last 30 days)
Suppose it is known that the graph of the function ๐‘ฆ(๐‘ฅ)=๐‘Ž๐‘ฅ3+๐‘๐‘ฅ2+๐‘๐‘ฅ+๐‘‘ passes through four given points (๐‘ฅ๐‘–,๐‘ฆ๐‘–),where ๐‘–=1,2,3,4. Write a user-defined function that accepts these four points as input and computes the coefficients ๐‘Ž, ๐‘, ๐‘, and ๐‘‘. The function should solve four linear equations in terms of the four unknowns a, b, c, and d. Test your function for the case where ๐‘๐‘œ๐‘œ๐‘Ÿ๐‘‘=[โˆ’2,โˆ’20; 0,4; 2,68; 4,508] , whose answer is ๐‘Ž=7, ๐‘=5, ๐‘=โˆ’6, and ๐‘‘=4. Plot the function as a solid UoP purple line and the coord points as UoP blue triangular markers with no line on the same axis. Label and format the graph.

Answers (0)

Categories

Find more on Line Plots 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!