Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- Future<MatlabEngine> eng = MatlabEngine.startMatlabAsync();
- MatlabEngine ml = eng.get();
- ml.eval("x = 0:pi/100:2*pi;");
- ml.eval("y = sin(x);");
- ml.eval("y2 = sin(x-.25);");
- ml.eval("y3 = sin(x-.5);");
- ml.eval("plot(x, y, x, y2, x, y3);");
- //plotのあと軸を追加
- ml.eval("xlabel('x = 0:2\\pi');");
- ml.eval("ylabel('Sine of x');");
- ml.eval("title('Plot of the Sine Function','FontSize',12);");
- ml.eval("legend('sin(x)','sin(x-.25)','sin(x-.5)')");
- ml.eval("saveas(gcf,'sample.png')");
- ml.eval("pause(30);");
- }
Add Comment
Please, Sign In to add comment