Skip to main content
\(\newenvironment{mat}{\left[\begin{array}}{\end{array}\right]} \newcommand{\colvec}[1]{\left[\begin{matrix}#1 \end{matrix}\right]} \newcommand{\rowvec}[1]{[\begin{matrix} #1 \end{matrix}]} \newcommand{\definiteintegral}[4]{\int_{#1}^{#2}\,#3\,d#4} \newcommand{\indefiniteintegral}[2]{\int#1\,d#2} \def\u{\underline} \def\summ{\sum\limits} \newcommand{\lt}{ < } \newcommand{\gt}{ > } \newcommand{\amp}{ & } \)

Section6Mathematica

  • Some Useful Commands

    • The "Replace" command strips the numerical value off of a solution, or list:
      width = Solve[CDF[StudentTDistribution[n - p], x] == 1 - (1 - conf)/2, x, Reals][[1]]
      width = x /.width
      
      I seem to need this one a lot. You can find other examples of this from the help info for the Solve command.
    • A comment on the Clear command....

      • Clear[x] -- clears just x

      • Clear["Global `*"] -- clears everything

        Is a good command to put at the top of a file (although someone might get mad if you slip that in on them and they have expended a lot of energy getting some results, which will get lost!).

      • If you're working interactively, you can quit the kernel from the Evaluation menu. That also clears out memory.
  • Other Stuff