Search code examples
inputmaxima

Ask for an input to define a variable


I want to plot an expression in Maxima. Indeed, I want from Maxima to ask me for an input and allocates that to a variable which is used in plotting, but I don't know what is the command line for asking an input.


Solution

  • read

    (%i1) load("draw") $
    (%i2) om: read("Enter `om' followed by a semicolon (;)") $
    Enter `om' followed by a semicolon (;) 
    3;
    (%i3) draw2d(explicit(sin(om*'x), 'x, 0, 2*%pi)) $