From version 4.0.0, mjograph can be called from Matlab, where you can use it as an alternative to the “plot” command.

see here for setup http://www.ochiailab.dnj.ynu.ac.jp/mjograph/matlab-setting-e.html



mjograph interacts with Matlab with the “mplot” and “mfigure” commands which you can use after some easy setup was properly done.

The usage of these commands is easy and almost the same as the “plot” and “figure” commands in Matlab.

mplot

perform plotting (alternative to the “plot” command)

 

  1. •mplot(y, 'overwrite') --- plot y. previous plot from the same variable will be overwritten.

  2. •mplot(y) --- same as above.

  3. •mplot(y, 'new') --- plot y as a new series.


  4. •mplot(x, y, 'overwrite') --- plot the pair of x and y. previous plot from the same pair of variables will be overwritten.

  5. •mplot(x, y) --- same as above.

  6. •mplot(x, y, 'new') --- plot the pair of x and y as a new series.

mfigure

activate a graph window. (The same role as the “figure” command)

  1.     mfigure(index):  activate a graph window. The index  must be between 0 and 24. The index can be omitted.

x = 1:100;

y = x.^2;

mplot(x, y);  % you will get a quadratic function.

y = x.^3;

mplot(x, y); % the quadratic function will change to cubic.

y = x.^2;

mplot(x, y, ‘new’); % another quadratic function will be plotted as a new entry.

mfigure; % a new graph window will open.

mplot(randn(1, 1000));  % you will get a noise-like waveform in the new window.

example