Evaluate the value of the matrix polynomial 2x^2 + 3x+ 4, given that the square matrix is x = [1 -3 2; 5 1 8; 6 4 3].
2 views (last 30 days)
Show older comments
Evaluate the value of the matrix polynomial 2x^2 + 3x+ 4, given that the square matrix is x = [1 -3 2; 5 1 8; 6 4 3].
1 Comment
Steven Lord
on 13 Dec 2021
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.
If this is not a homework assignment just use the polyvalm function.
Answers (1)
Eswaramoorthy
on 1 Mar 2023
Edited: Eswaramoorthy
on 1 Mar 2023
Hi,
You can use the 'polyval' or 'polyvalm' function.
% Define the matrix x
x = [1 -3 2; 5 1 8; 6 4 3];
% Define the coefficients of the matrix polynomial
c = [2 3 4];
% Use the polyvalm function to evaluate the matrix polynomial
y = polyval(c, x);
% Display the result
y
Output:
y = 3×3
9 13 18
69 9 156
94 48 31
For more info on polvalm function, refer documentation:
Hope this helps!
0 Comments
See Also
Categories
Find more on Polynomials 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!