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 (최근 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
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
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!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Polynomials에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!