Send data from MATLAB to HTML form

조회 수: 5 (최근 30일)
Michael
Michael 2011년 4월 18일
In my MATLAB program, I have calculated some features from sensor data. Now I want to use this data in a virtual reality program to change some parameters.
I can already make a connection with this program through http://localhost:8888 I then get a webpage where I can fill in values and click a send button so that the parameters change.
I want to use all this in real-time, so the features I calculated should be passed into an HTML page and sent to the virtual reality program automatically.
Can this be done?

답변 (2개)

Walter Roberson
Walter Roberson 2011년 4월 18일
I'm not certain but it sounds like you either want urlwrite() or the Java Robot class.

Michael
Michael 2011년 4월 19일
Thank you for your fast answer! I don't think urlwrite() is usefull here because it saves a url but the function doesn't execute it.
Because of your suggestion of java, I googles a bit and found this:
I think that the function ClientHttpRequest is exactly what I need. However, I have never used java in matlab and I can't seem to get it working. I have put the ClientHttpRequest.class in both the dynamic and the static javapath but I can't call it from matlab. Can anybody explain me how I should call this?
Thanks,
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 4월 19일
urlread with 'post' method, perhaps.
str = urlread(URL,method,{Name,Value}) passes data to the server using a method of 'get' or 'post'. Specify the data to send with one or more Name,Value pair arguments.
I have not used either one very much at all; I have seen in the past that people doing more complicated manipulations have usually had to use urlwrite() as (at least at the time) it was more flexible on matters such as additional headers.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by