00:01
Aa is a 6x6 matrix.
00:04
Cc is a 6x1 matrix, that is a column vector of 6 rows.
00:11
The following is a matrix equation.
00:13
Aa times tt equals cc.
00:16
That is, column vector cc is the right -hand side of the linear system where the coefficient matrix is aa.
00:23
And tt corresponds to the unknown vector here.
00:26
Column vector tt has coordinates or components t1 t2 t3 t4 t5 t6 which are indeed the variables and here we have the coefficient matrix aa right here as i said before this is the unknown vector tt with the separate unknowns let's say t1 t2 up to t6 and this is the right hand side vector cc see it's a column vector of six rows so we get to find the vector tt that satisfies this system by using matlab and so for that what we're going to do is first let's say we have this is the matlab prompt and then we get to define a a and that we do by naming the variable capital a capital a a equal is the assignment statement in matlab and we use square bracket to start the definition of metrics and we put the entries separated by comma or spaces i'm going to use spaces one zero zero zero zero zero that's the first row right here then we write down the second row here that is negative 0 .0408, then the next element is 0 .0888, then negative 0 .0408, and we have three zeros.
02:23
Zeros we are supposed to continue the same line when we are at the prompt of met number i'm going to of course continue down here the next line here so we get zero zero negative zero point 0 .0408 then 0 .08888 and negative 0 .0408 and then two zeros okay and we continue that way for the other rows and we get the following and so we get this and i'm going to emphasize here the semicolons defining the end of each row so you can follow easier how we enter those rows in matlab so we are just putting each row separated by a semicolon and inside each row we separate the entries by spaces we can also use columns for that but i'm going to use spaces and we notice the first row is one zero zero zero zero zero and then the last row it has the last element on the right here 0 .0 4 4 5 5 and besides that you can see that all entries in each row are the three main entries non -zero entries are equal and they are displacing to the right they are getting further to the right when we advance advanced rows.
04:24
So that's the way to enter the metrics and we get to close of course the square bracket indicating the metrics is completed.
04:34
And if we don't want the metrics to be print on screen after we hit enter here at this comment we got to put a semicolon.
04:45
This semicolon right here is just indicating matlab not to print on screen the result of the assignment.
04:51
But if we want to it to do it we don't put the semicolon at the end of the statement.
04:59
Let's say we keep the semicolon at the end not to print the result of the statement.
05:07
So we have defined this way the matrix, the coefficient matrix aa.
05:12
Now we define the right -hand side cc.
05:15
And we want this to be a column vector also.
05:18
So each row has only one number.
05:21
The first row is number 100.
05:24
So it's 100.
05:26
That's the only number in the first row so we use semicolon to go to the second row in that 0 .144 as we see right here and all elements are the same up to the previous to last element so we get 0 .144 semicolon 0 .144 another one 0 .144 and the last element the last row is this number right here 0 .075 and we close the matrix there square bracket closing square bracket and we put a semicolon after the square bracket the closing square bracket for matlab not to print on screen the result of the assignment so we have defined the coefficient matrix a a with six rows and six columns and the right hand side cc a column vector with these entries and now we're ready to calculate the solution in matlab and that's simply done by using the backslash statement and we can assign the result to a variable let's say so indicating solution equal coefficient matrix a a backslash right hand side cc and we put a semicolon not to print the result but we want to print the result so we either either get rid of the semicolon right here or we print the solution simply by displaying the variable containing the solution.
07:35
Remember matlab is case sensitive so if i write down the variable with all capital letters you get to always write that variable with capital letters to refer to the same variable.
07:50
If you change something of the captions of the letter, you're going to get another variable.
07:57
So that's it.
07:59
And that's the way to solve it.
08:01
In this case, backslash is going to apply the appropriate method.
08:07
In some cases, apply gaussian elimination with pivoty, or sometimes apply another method depends on the characteristic or features of the coefficient matrix.
08:21
In this particular case, the coefficient matrix here, aa has a relatively small condition number, maybe, or determinant is relatively small, but the solution is not so bad...