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 次查看(过去 30 天)
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 个评论
Steven Lord
Steven Lord 2021-12-13
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.

请先登录,再进行评论。

回答(1 个)

Eswaramoorthy
Eswaramoorthy 2023-3-1
编辑:Eswaramoorthy 2023-3-1
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!

类别

Help CenterFile Exchange 中查找有关 Polynomials 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by