Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tien4112004/lab-ppt-ck
Lab PPT CK
https://github.com/tien4112004/lab-ppt-ck
Last synced: about 1 month ago
JSON representation
Lab PPT CK
- Host: GitHub
- URL: https://github.com/tien4112004/lab-ppt-ck
- Owner: tien4112004
- Created: 2024-05-29T07:06:37.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-29T16:08:42.000Z (8 months ago)
- Last Synced: 2024-05-29T19:55:12.343Z (8 months ago)
- Language: MATLAB
- Size: 113 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lab-PPT-CK
Lab PPT CK## Find root of a linear algebra systems
```matlab
% Define the coefficient matrix A and the right-hand side vector b
A = [3, 2; 1, 4];
b = [7; 3];% Solve the system of equations Ax = b
x = A \ b; or x = x = linsolve(A,b)
```
## Get coefficients of the polynomial
```matlab
% For example, the polynomial is f = @(x) x^3 - 6x^2 + 11x - 6
coef = coeffs(f, All)
```
## Find root of a polynomial
```matlab
% Define the coefficients of the polynomial
% For example, for the polynomial x^3 - 6x^2 + 11x - 6, the coefficients are [1, -6, 11, -6]
coefficients = [1, -6, 11, -6];
% Find the roots of the polynomial
roots = roots(coefficients);% If there's a complex one like: f = @(x)exp(m*x/10) - m*x^2 - x*sin(m*x/10)
% Use fsolve function with x0 is the initial value:
roots = fsolve(f, x0)
```