Matlab and websites (Web integrating)

50 visualizaciones (últimos 30 días)
Milinda
Milinda el 24 de Abr. de 2012
Comentada: Walter Roberson el 21 de Jul. de 2018
I have a project where I will utilizing image processing and neural networks. The tool that I am using for this is matlab. The system is a web based system and the examples I have seen and worked with is currently desktop based. Does anyone know how I would create a website layer on top of the image processing and neural network part?
The simplest structure would be something like
Web site -> Provide input -> Process through image processing and neural networks -> Provide output in the website
The most simple way would be to use Java and call some matlab program in the server and have matlab write to the database with the output, how would I accomplish this? How would I host the matlab code in the server and the java code at the same time? How would I write to the mysql using Matlab? This would be the current primary question that requires answering
While this would work, additionally if possible I would also like to have the website more interactive with the process, like when I wan't to control the intensity for some threshold in some part regarding image processing (Perhaps compiling the matlab code into a jar and integrating)
Additionally I also require to write to a database, mysql if possible
It would be a bonus if I could combine Java EE with matlab as I already have code which I can use from java. Howeve the mandatory requirement is that I create a website which can get the job done
Regards, Milinda

Respuestas (2)

Juan B. Gutierrez
Juan B. Gutierrez el 18 de Mayo de 2012
About your questions:
Does anyone know how I would create a website layer on top of the image processing and neural network part?
YES! It is actually quite simple. You have to package your MATLAB component and use it as a class in your web technology. As mentioned in a previous answer, you loose the GUI, but the numeric functionality (and the ability create plots, files, etc) remains the same. See details in the next paragraphs.
The most simple way would be to use Java and call some matlab program in the server and have matlab write to the database with the output, how would I accomplish this?
Depending upon the number of concurrent users in your web server, you might NOT want to simply call a MATLAB executable from your Java web application. You probably want to use shared memory and message queuing. Therefore, you already have the answer: Use the Java Builder toolbox , which allows you to compile MATLAB programs as Java classes... at that point you have the full machinery of Java EE, and calling the MATLAB Java component is the same as calling any Java class.
How would I host the matlab code in the server and the java code at the same time?
Previous paragraph, with an addendum: You will need to instal MATLAB's MCR on the server, which is royalty free, i.e. you do not need MATLAB on the server. I answered a similar question in the context of .NET... but the process is completely analogous. See http://www.mathworks.com/matlabcentral/answers/26255-matlab-vs-visual-net
How would I write to the mysql using Matlab? This would be the current primary question that requires answering
I also answered that question in detail in another post. See http://www.mathworks.com/matlabcentral/answers/37595-how-can-i-read-database-from-database-row-by-row. In that solution, I explain how to access a MySQL database with .NET. The the Java equivalent is completely analogous, since you can create Java classess from within MATLAB, that is to say, create your database access program in Java, test it, and then port the class calling part to MATLAB (using full qualifiers for the class names)
I hope that helps. Good luck.
  4 comentarios
Abbass Abbassi
Abbass Abbassi el 20 de Jul. de 2018
Yes they allow for PHP but not a windows compiled executable
Walter Roberson
Walter Roberson el 21 de Jul. de 2018
You will probably have to find a different hosting system. (Unless they permit Linux executables, in which case you would compile for Linux)

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 24 de Abr. de 2012
Have you considered using Mathworks' Java Builder product?
  2 comentarios
Milinda
Milinda el 24 de Abr. de 2012
Yes this does solve compiling issues but it seems to have trouble with Neural Networks. Additionally I am looking for a way where a hosted Matlab program could be called from Java and have the answer written to the database or an answer returned.
Walter Roberson
Walter Roberson el 24 de Abr. de 2012
My recollection is that Neural Networks are supported by Java Builder, both for design and for classification using existing networks. My (possibly faulty) memory is telling me that until recently, creating new networks was not allowed. I could be wrong about that.
I do know, though, that the graphical NN tools are not supported -- and as best I recall, the MATLAB license does not permit compiled applications to give access to those graphical tools.
Java Builder supports everything that MATLAB Compiler supports.
Calling a hosted MATLAB program could possibly be most easily done by using the MATLAB Automation server, but only if the web server is running on MS Windows. It would then be an ActiveX invocation. (I don't know how to do that in Java.)
Outside of MS Windows with ActiveX, you would have Java exec the appropriate process, using the -nodesktop flag, and using the -r flag to specify the expression to start executing.

Iniciar sesión para comentar.

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by