4620 Homework 1

The following programming assignments should be fairly straight forward. You can use any programing language or tool that you want.

Hints

Dia=DiagonalMatrix[{1,2,3}];
Dia=Table[0,{3},{3}];
Do[ Dia[[i,i]]=-4,{i,3}];
LD=0*Dia;
Do[ LD[[i+1,i]]=1,{i,2}];
MatrixForm[LD]

n=4;
A=Table[Random[],{n},{n+1}];
SplitMatrix[A_List] := Module[
{i,j,n,m},
{n,m}=Dimensions[A];
{
Table[
If[i>j,A[[i,j]],0],
{i,n},{j,m}],
Table[
If[i==j,A[[i,j]],0],
{i,n},{j,m}],
Table[
If[i<j,A[[i,j]],0],
{i,n},{j,m}]
}
]
{LMat,DMat,UMat}=SplitMatrix[A];
MatrixForm[UMat];
MatrixPlot[UMat]
ArrayPlot[UMat]
ListDensityPlot[UMat]
ListPlot3D[UMat]

Coun

CountZeros[A_List]:=Module[
{},
Length[Cases[Flatten[N[A]],0.0]]
]
CountZeros[UMat]
?Chop

n=4;
Vec=Table[ Sin[x], {x, 0., π, π/24}];
ListPlot[Vec]

Vec

Dia

n=(({{-2, 0, 0, 0, 0, \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {0, -2, 0, 0, 0, \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {0, 0, -2, 0, 0, \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {0, 0, 0, -2, 0, \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {0, 0, 0, 0, -2, \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}}));
Vec=Table[ Sin[x], {x, 0., π, π/24}];
ListPlot[Vec]
A={
{3,3,8},
{4,5,6}
};
b={
{1},
{2}
};
MatrixForm[ArrayFlatten[{{A,b}}]]