Array<double> x = findgen(1001)/100; plot(x,sin(x)); // A more sophisticated plot... // We create first a window to display the plot, ie a plotDisplay object. // parameters of the window declaration are the window size (x,y), the window title, and the axis names. plotDisplay display(400,300,"Multiple plots...", "Time", "Volt"); plot(display,x,sin(x),red); // First plot added to the display plot(display,x,cos(x^2)*exp(-x/3),blue); // Second plot added. activate(display); // activate makes the window alive... // It can be resized, zoomed in (right click to draw a box), etc...
// Terminal window, to display and read text Terminal trm; // Opens a terminal window print(trm, "This is a terminal window"); // Print a string on the terminal // Read a string from keyboard string str; str = read(trm, "Enter some text: "); print(trm, "You entered: " + str, blue); Array<int> a; // Creates a simple 1D vector a = vect<int>(1,2,3,4,5,6); // Print array data print(trm,a,green); read(trm, "Hit enter to finish.", red);