Using MATLAB command can anyone solve this questio

조회 수: 1 (최근 30일)
Iqra Maqbool
Iqra Maqbool 2021년 12월 5일
댓글: Chunru 2021년 12월 5일
For a linear system A²x=b is such that A is non singualr with A=2x2 matrix and b=2X1 find the solution

답변 (3개)

Chunru
Chunru 2021년 12월 5일
% Some random input
A = rand(2, 2)
A = 2×2
0.2997 0.6504 0.8340 0.9402
b = rand(2,1)
b = 2×1
0.8589 0.7070
% Solution
x = (A*A)\b
x = 2×1
9.6451 -6.4970
% To veryfy that: A*A*x = b
A*A*x
ans = 2×1
0.8589 0.7070

Iqra Maqbool
Iqra Maqbool 2021년 12월 5일
Thankyou...same question if A-¹ and b is given.. Write command incase of A(inv) and b
  댓글 수: 1
Chunru
Chunru 2021년 12월 5일
A = rand(2, 2);
Ainv = inv(A); % Ainv is given
b = rand(2,1);
% Solution
x = Ainv*Ainv*b
x = 2×1
0.4475 0.8968

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2021년 12월 5일
syms A [2 2]
syms b [2 1]
syms x [2 1]
eqn = A^2 * x == b
eqn = 
solution = solve(eqn, x)
solution = struct with fields:
x1: (b1*A2_2^2 - A1_2*b2*A2_2 - A1_1*A1_2*b2 + A1_2*A2_1*b1)/(A1_1^2*A2_2^2 - 2*A1_1*A1_2*A2_1*A2_2 + A1_2^2*A2_1^2) x2: (b2*A1_1^2 - A2_1*b1*A1_1 + A1_2*A2_1*b2 - A2_1*A2_2*b1)/(A1_1^2*A2_2^2 - 2*A1_1*A1_2*A2_1*A2_2 + A1_2^2*A2_1^2)
  댓글 수: 1
Walter Roberson
Walter Roberson 2021년 12월 5일
syms A [2 2]
syms b [2 1]
syms x [2 1]
eqn = inv(A) * x == b
eqn = 
solution = solve(eqn, x)
solution = struct with fields:
x1: A1_1*b1 + A1_2*b2 x2: A2_1*b1 + A2_2*b2

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by