Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*Mathematica 8 start*)nn = 7;
- a = RandomReal[{-1, 1}]
- Print["b = the numbers fed in"]
- b = Table[n + RandomReal[{-1, 1}], {n, 1, nn}]
- A = Table[
- Table[If[n == k, a, If[n > k, RandomReal[{-1, 1}], 0]], {k, 1,
- nn}], {n, 1, nn}];
- B = Transpose[A]*b[[Range[nn]]];
- c = (x /. Solve[Expand[Det[A.B - x*A]] == 0, x])/a;
- Print["c = solutions to the polynomial"]
- Sort[c, Less]
- Print["The matrix A.B"]
- TableForm[A.B]
- (*end*)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement