Skip to content

Instantly share code, notes, and snippets.

@vlad17
Created December 3, 2016 21:23
Show Gist options
  • Save vlad17/b8821ff25803e04260ba3e41e16fcac0 to your computer and use it in GitHub Desktop.
Save vlad17/b8821ff25803e04260ba3e41e16fcac0 to your computer and use it in GitHub Desktop.
Mathematica code for generating toeplitz condition numbers
URLDownload[
"http://library.wolfram.com/infocenter/MathSource/6770/\
MatrixManipulation.m?file_id=6180", "/tmp/MatrixManipulation.m"];
Quiet@Needs["LinearAlgebra`MatrixManipulation`",
"/tmp/MatrixManipulation.m"];
ListLinePlot[
Table[LinearAlgebra`MatrixManipulation`MatrixConditionNumber[
RandomReal[
]*ToeplitzMatrix[Reverse@Range[n]^10]], {n, 2 ^Range[9]}],
PlotLabel -> "poly deg 10"]
ListLinePlot[
Table[LinearAlgebra`MatrixManipulation`MatrixConditionNumber[
RandomReal[
]*ToeplitzMatrix[Exp[1 - Range[n]]]], {n, 2 ^Range[9]}],
PlotLabel -> "exp decay"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment