How to port from Matlab to Headless Octave for Web

前端 未结 2 1563
北荒
北荒 2021-01-28 10:05

I have a Matlab application that I wrote and would like to put on a AWS server running Octave to make a service publicly available via the web. I\'ve never used Octave.

2条回答
  •  后悔当初
    2021-01-28 10:33

    I downloaded and installed Octave onto an Ubuntu Mace OS running on VMware on my Mac. This part was seamless and easy. First I tested my code in headless mode with Matlab on the Mac with this command:

    /Applications/MATLAB_R2018a.app/bin/matlab -nodisplay  -nosplash -nodesktop -r "run('mycode.m');quit;"
    

    It produced the correct output which is a plot with four graphs saved as a jpeg and some analysis text to stdout.

    Then I switched to the Ubuntu machine with Octave. This resulted in multiple failures. Octave is missing many of the functions that are in the Matlab core. Like readtable(), which reads in a csv file. It's also missing the notion of a table object. So with that, I was kind of dead in the water.

    I started the interactive version of Octave to see what efficacy it had, and plot would not work. To make plot() function I did had to do the following:

    graphics_toolkit ("gnuplot");
    

    Plot then worked very well and was pretty consistent with Matlab after that, but too much else was missing from it to port my project over without considerable effort and a completely new code branch.

    All this said, I think Octave is a very nice tool, but I also believe that it is so considerably divergent from Matlab 2018a that using the two interchangeably is nearly impossible.

    I called Mathworks and my license allows me to run 2 copies, but what I didn't know is they don't have to be on the same OS. So I can install a Linux version on my data server and continue to develop on my Mac. Problem solved. Thank you Mathworks.

提交回复
热议问题