matlab code to obtain thenew right hand side b of a linear equation after transforming the matrix A to another matrix

2 views (last 30 days)
Solving linear equations Given a linear equation of the form Ax=b For example where A=[6 2 4;3 4 3; 3 1 2] and b=[26 19 13]' A =
6 2 4
3 4 3
3 1 2
b =
26
19
13
Case 1
The elements of A is multiplied by (-1) except the diagonal elements to give matrix G=[6 -2 -4;-3 4 -3;-3 -1 2] and the new b denoted by c =[-2 -11 -1]'
G =
6 -2 -4
-3 4 -3
-3 -1 2
c =
-2
-11
-1
I need matlab code to transform matrix A to matrix G and vector b to vector c
Case 2 I want to form another linear equation which is A’x=k how do I obtain my k from b after finding the transpose of A. A'= 6 3 3 2 4 1 4 3 2

Answers (0)

Categories

Find more on Operating on Diagonal Matrices 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!