1

I have a simple matlab code. It loads a file and draws a graph using datas in this file. I want that when I press a html button, the graph is drew.I read some recommendations on web/blogs. Have to I use com server?

EDIT

My app is not a web app yet. I run it local pc, it is just a htm file.I use google chrome for now.

zakjma
  • 2,030
  • 12
  • 40
  • 81
  • 2
    Your best bet is just porting it to JavaScript. – PitaJ Feb 20 '15 at 15:15
  • @PitaJ,when I search porting code, I find solution about convert code. Should I convert the code matlab to javascript? – zakjma Feb 20 '15 at 15:26
  • When you press a html button on what browser (Matlab or other) ? Is Matlab installed on your server ? Please give some details, we cannot read in you mind. – Ratbert Feb 20 '15 at 15:28
  • From the title of your question, I would say yes. – kkuilla Feb 20 '15 at 15:28
  • I don't have a server yet. It works my local. It is just a htm file. I use google chrome for now. – zakjma Feb 20 '15 at 15:31

2 Answers2

2

The answer to your question is not necessary, you could have some workarounds to avoid using a COM server (although it's well explained in the official documentation).

It depends if your webapp is a Java application, PHP, etc.

A simple approach using PHP would be using passthru to run your matlab app and later you could link to the generated file.

Related questions:

Community
  • 1
  • 1
Leandro Carracedo
  • 7,233
  • 2
  • 44
  • 50
1

One way to do so would be for you to generate the C++ code out of Matlab code using Matlab coder, then there are a few way ways to run C/C++ codes in the browser, see below links:

Running C in A Browser and Native client

It is worthwhile to mention that it might not be the best idea and you might face many fundamental issues since you are practically converting Matlab code two times to different programming languages. Currently, there are many issues with Google Native Client, including the fact that you can not run it on every browser, other services are essentially better than the google native client.

Finally, if you have a simple code I would recommend you to rewrite it in JS instead of going throw all the trouble.

M.Hossein Rahimi
  • 557
  • 2
  • 9
  • 20