working on matrices 3x3 in Matlab (2)

So after a few days of working on the matrices and its mathematical operations, theories and conceptional components (especially with matlab), I found a useful way to quickly determine whether a system is, either unique solution, no solution, or infinite solution.

First of all, I think I have thought too much about matrices and constructing a program. The objective, after spending a few days indeed, is probably just to find out "what number will produce" each of the three conditions. However, number goes on forever. But if we set a range for alpha and beta (the two variables we use) in the program, then there is a purpose for the program.

Matlab, just like any other programming language, has its own library, a collection of operations and pre-defined source-codes to use through the MatLab. For matrices, we do not need to worry about the operations. I probably had thought too much about "writing a program". I can still develop one, it isn't that hard once you know matrices' operations.

I can also make the program without doing the loop, simply just a program with the following sets of statements, and return a message to tell which condition is produce.

Now, the tools to determine each conditions quickly is to use the rule of "rank".

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
>> alpha = 3, beta = 4, A=[(alpha) 2 0;0 1 2; 0 0 0], b=[(beta);0;1], rref(A), X=A\b, rref([A b]), rank(A), rank([A b])

alpha =

     3


beta =

     4


A =

     3     2     0
     0     1     2
     0     0     0


b =

     4
     0
     1


ans =

    1.0000         0   -1.3333
         0    1.0000    2.0000
         0         0         0

Warning: Matrix is singular to working precision.

X =

   NaN
  -Inf
   Inf


ans =

    1.0000         0   -1.3333         0
         0    1.0000    2.0000         0
         0         0         0    1.0000


ans =

     2


ans =

     3

if rank(A) = rank([A b]) = u.s and infinite solution may exit
else
no solution exit

if rank(A) = # of unknowns, u.s exit
else
infinite solution exit.

If these statements are valid and true, then the first half of the program is just to create a loop and set a range to alpha and beta. The computer will print out the pair of alpha and beta when (1) there is no solution and (2) infinite solution. For unique solution, there is no need to print out the alpha and beta. Clear enough?

working on matrices 3x3 in Matlab (1)

Okay, let's cut this short.

So far so good just need references to guide me through to crack down the concepts.

For Matrices, according to the alternative theorem,there should be 3 cases
1. Det =/ 0 and it's has unique solution
2. Det = 0, no solution
3. infinite solution

What I don't get is how do you determine something is infinite solution. To construct a program in Matlab isn't that difficult. All it takes is time to learn the ways to program in Matlab., The problem is the set of rules to determine the value of Alpha and Beta (input) and matrices (calculations). We can simply use det = or =/ 0 to determine something is either case 1 or case 2.

Well .... it seems something is working here.
when the last two numbers in the last rows are the same and the alpha and the first number in the last row are the same, it produces 0 det and infinite solution and also if we make the last row completely empty with zero, also infinite solution.
I guess I need to go through the references and see what I can do with it.

My first thought on Matlab

I will probably give another thought later when I get used to Matlab. As far as my study with the common programming languages, like Perl and C++, I do see a big difference in Matlab. This is more a mathematical language than what we usually expect from a programming language. However, people use Matlab for engineering projects because of the capacity of the mathematics offers by Matlab.

I don't know. I am the kind of person that needs real introduction to every language, from the most basic "Hello-World" script to the most advance (you write whatever you want!!!). I have to spend sometime finding a good book covering Matlab. There are some helpful sources online but the technical references they use, someone strike me down.

At the moment I am dealing with Matrices. Matrices aren't that difficult to understand, it's just math. But my pre-calc class was two years ago. I didn't remember any matrices operation at all. I probably need extra time to get use to the way Matlab writes program and how it works with numbers and command.

Here is the matrices

1
v=[1, 2, 3, 4], b=[4;5;6;7], v*b

Output

1
2
3
4
5
6
7
8
9
10
11
12
13
14
v =

1     2     3     4

b =

4
5
6
7

ans =

60