<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Interactive web pages in MATLAB, part 3</title>
	<link>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/</link>
	<description>Ken &#38; Mike work on the MATLAB Desktop team</description>
	<pubDate>Sun, 22 Nov 2009 23:34:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-6300</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Mon, 22 Jun 2009 14:02:04 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-6300</guid>
		<description>Answer to @Ashwin up in new post: &lt;a href="http://blogs.mathworks.com/desktop/2009/06/22/interactive-web-pages-in-matlab-part-4/" rel="nofollow"&gt;http://blogs.mathworks.com/desktop/2009/06/22/interactive-web-pages-in-matlab-part-4/&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Answer to @Ashwin up in new post: <a href="http://blogs.mathworks.com/desktop/2009/06/22/interactive-web-pages-in-matlab-part-4/" rel="nofollow">http://blogs.mathworks.com/desktop/2009/06/22/interactive-web-pages-in-matlab-part-4/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashwin</title>
		<link>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-6278</link>
		<dc:creator>Ashwin</dc:creator>
		<pubDate>Wed, 03 Jun 2009 04:55:48 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-6278</guid>
		<description>Well thanks Mike for your reply. I needed it urgently since I have to get the demo ready at a conference in july. I am thinking of working arnd in the sense.. Calling Matlab from Javascript like u said and passing 4 values into my algorithm. then copyin the algorithm returned values into a file and then calling this file into my html using ajax or something. I dunno if its possible(given I am Elec Engg Major who doesnt ve good knowledge of anything except matlab)...but i will give it a try. If you can give me a solution or perhaps email me on the ID above.it would work wonders..

Thanks
Ashwin</description>
		<content:encoded><![CDATA[<p>Well thanks Mike for your reply. I needed it urgently since I have to get the demo ready at a conference in july. I am thinking of working arnd in the sense.. Calling Matlab from Javascript like u said and passing 4 values into my algorithm. then copyin the algorithm returned values into a file and then calling this file into my html using ajax or something. I dunno if its possible(given I am Elec Engg Major who doesnt ve good knowledge of anything except matlab)&#8230;but i will give it a try. If you can give me a solution or perhaps email me on the ID above.it would work wonders..</p>
<p>Thanks<br />
Ashwin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-6277</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Tue, 02 Jun 2009 15:28:13 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-6277</guid>
		<description>Ashwin,

 It is possible, but complicated. I have at least one viable solution for this, but its too intricate to post as comment here. I'll add it to my queue of future posts and try to get to it before R2009b drops with all its new features.</description>
		<content:encoded><![CDATA[<p>Ashwin,</p>
<p> It is possible, but complicated. I have at least one viable solution for this, but its too intricate to post as comment here. I&#8217;ll add it to my queue of future posts and try to get to it before R2009b drops with all its new features.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashwin</title>
		<link>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-6266</link>
		<dc:creator>Ashwin</dc:creator>
		<pubDate>Fri, 29 May 2009 17:54:58 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-6266</guid>
		<description>Hi Mike,

This tutorial is very helpful. How ever..How about I need to return Matlab Values back to Javascript..for instance I need to have somethign like this

on the browser
Input 1st Number:
Input 2nd Number:

Result:

Now When the user enters numbers 1 and 2…..javascript will call matlab and Matlab will compute the result(for eg Add) and return the result back to the Result box.

I knw how to pass values from JS to Matlab..But how to do it vice versa.

My primary aim for this is as follows.

I am sending X and Y coordinates from JS to Matlab. I have an Algorithm ready in Matlab which will take these values and give a result and this result needs to passed back to JavaScript..


Sorry I might have posted it in a different comments section :(

This is the final stage of my project. When I am finished, I will upload u the link and you can check it out. Its basically a Unmanned Air vehicle and target threat detection scenario....with Google Earth API(Hence JavaScript) and Communication Algorithm(Hence Matlab)..</description>
		<content:encoded><![CDATA[<p>Hi Mike,</p>
<p>This tutorial is very helpful. How ever..How about I need to return Matlab Values back to Javascript..for instance I need to have somethign like this</p>
<p>on the browser<br />
Input 1st Number:<br />
Input 2nd Number:</p>
<p>Result:</p>
<p>Now When the user enters numbers 1 and 2…..javascript will call matlab and Matlab will compute the result(for eg Add) and return the result back to the Result box.</p>
<p>I knw how to pass values from JS to Matlab..But how to do it vice versa.</p>
<p>My primary aim for this is as follows.</p>
<p>I am sending X and Y coordinates from JS to Matlab. I have an Algorithm ready in Matlab which will take these values and give a result and this result needs to passed back to JavaScript..</p>
<p>Sorry I might have posted it in a different comments section :(</p>
<p>This is the final stage of my project. When I am finished, I will upload u the link and you can check it out. Its basically a Unmanned Air vehicle and target threat detection scenario&#8230;.with Google Earth API(Hence JavaScript) and Communication Algorithm(Hence Matlab)..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-6203</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Fri, 24 Apr 2009 13:17:25 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-6203</guid>
		<description>Thuy,

 I am not entirely sure of what you want. If you are looking for a hyperlink to open a new or particular figure window in MATLAB, you can use the &lt;a href="http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/figure.html" rel="nofollow"&gt;&lt;tt&gt;figure&lt;/tt&gt;&lt;/a&gt; command and associate that figure's handle with the hyperlink. 

If you want to have multiple plots in your web page, then try creating a separate &lt;tt&gt;iframe&lt;/tt&gt; for each plot.</description>
		<content:encoded><![CDATA[<p>Thuy,</p>
<p> I am not entirely sure of what you want. If you are looking for a hyperlink to open a new or particular figure window in MATLAB, you can use the <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/figure.html" rel="nofollow"><tt>figure</tt></a> command and associate that figure&#8217;s handle with the hyperlink. </p>
<p>If you want to have multiple plots in your web page, then try creating a separate <tt>iframe</tt> for each plot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thuy</title>
		<link>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-6200</link>
		<dc:creator>Thuy</dc:creator>
		<pubDate>Thu, 23 Apr 2009 16:56:53 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-6200</guid>
		<description>Hi, I am creating 4 hyperlinks, and each shows a different plot.  However, I don't know how to create different windows for each plot.  
I want this:

If I click on hyperlink_1, I will see plot_1

Then I don't close that window, and I click on hyperlink_2, and I see another figure window with plot_2

Currently, when I click on the hyperlink consecutively, each plot overwrite the previous one.  I don't want this.  


Thanks.</description>
		<content:encoded><![CDATA[<p>Hi, I am creating 4 hyperlinks, and each shows a different plot.  However, I don&#8217;t know how to create different windows for each plot.<br />
I want this:</p>
<p>If I click on hyperlink_1, I will see plot_1</p>
<p>Then I don&#8217;t close that window, and I click on hyperlink_2, and I see another figure window with plot_2</p>
<p>Currently, when I click on the hyperlink consecutively, each plot overwrite the previous one.  I don&#8217;t want this.  </p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ali</title>
		<link>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-4378</link>
		<dc:creator>ali</dc:creator>
		<pubDate>Fri, 02 May 2008 17:26:33 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-4378</guid>
		<description>Hi Mike:
I have Matlab 2006a. So could I use Matlab webserver for this issue 
Actually, I do not have background on this topic but I am keep reading some documents from the net.</description>
		<content:encoded><![CDATA[<p>Hi Mike:<br />
I have Matlab 2006a. So could I use Matlab webserver for this issue<br />
Actually, I do not have background on this topic but I am keep reading some documents from the net.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-4376</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Fri, 02 May 2008 14:17:11 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-4376</guid>
		<description>Ali,

 I can't give you specific advice on your application, but you should check out our infamous &lt;a href="http://www.mathworks.com/support/tech-notes/1600/1608.html" rel="nofollow"&gt;Tech Note 1608&lt;/a&gt;. It describes how to deploy MATLAB applications to the web.</description>
		<content:encoded><![CDATA[<p>Ali,</p>
<p> I can&#8217;t give you specific advice on your application, but you should check out our infamous <a href="http://www.mathworks.com/support/tech-notes/1600/1608.html" rel="nofollow">Tech Note 1608</a>. It describes how to deploy MATLAB applications to the web.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-4042</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 09 Apr 2008 13:09:15 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-4042</guid>
		<description>Rahul,

 The easiest thing to change the text of the page and reload it:

Since I don't know how you are storing the desired address, let's say our address is stored in the variable a.

&lt;pre&gt;
a = 'www.mathworks.com';
html = sprintf('&#60;html&#62;&#60;body&#62;&#60;a href="%s" rel="nofollow"&#62;%s&#60;/a&#62;&#60;/body&#62;&#60;/html&#62;',a,a);
web(['text://' html])
&lt;/pre&gt;

This presumes you know the full text of your page, and where you want to insert the URL.

A slightly more complicated version allows you to specify the text in one spot (the header), and use javascript to make use of that expression. In the following snippet I'm just replacing a token $URL$ with the text still in the variable 'a'

&lt;pre&gt;
html = ['&#60;html&#62;&#60;head&#62;&#60;script type="text/javascript"&#62;theURL = $URL$;&#60;/script&#62;&#60;/head&#62;'...
    '&#60;body&#62;&#60;script type="text/javascript"&#62;document.write("&#60;a href=''"+theURL+"'' rel="nofollow"&#62;"+theURL+"&#60;/a&#62;");&#60;/script&#62;&#60;/body&#62;'];
html = strrep(html,'$URL$',['"' a '"']); web(['text://' html])
&lt;/pre&gt;

Because we don't have access to the internals of the web browser, any change from the MATLAB workspace will need a refresh to reflect those values back in the html text. To have your page be a more "traditional" dynamic page with HttpRequest or similar mechanism, you'll have to deploy your MATLAB code to an actual web server. 

If you're creative enough you can probably have that sever local, and maybe even the same MATLAB session, but that is beyond my expertise. To get started in that direction, check out our tech note on the subject: 
&lt;a href="http://www.mathworks.com/support/tech-notes/1600/1608.html" rel="nofollow"&gt;
http://www.mathworks.com/support/tech-notes/1600/1608.html&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Rahul,</p>
<p> The easiest thing to change the text of the page and reload it:</p>
<p>Since I don&#8217;t know how you are storing the desired address, let&#8217;s say our address is stored in the variable a.</p>
<pre>
a = 'www.mathworks.com';
html = sprintf('&lt;html&gt;&lt;body&gt;&lt;a href="%s" rel="nofollow"&gt;%s&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;',a,a);
web(['text://' html])
</pre>
<p>This presumes you know the full text of your page, and where you want to insert the URL.</p>
<p>A slightly more complicated version allows you to specify the text in one spot (the header), and use javascript to make use of that expression. In the following snippet I&#8217;m just replacing a token $URL$ with the text still in the variable &#8216;a&#8217;</p>
<pre>
html = ['&lt;html&gt;&lt;head&gt;&lt;script type="text/javascript"&gt;theURL = $URL$;&lt;/script&gt;&lt;/head&gt;'...
    '&lt;body&gt;&lt;script type="text/javascript"&gt;document.write("&lt;a href=''"+theURL+"'' rel="nofollow"&gt;"+theURL+"&lt;/a&gt;");&lt;/script&gt;&lt;/body&gt;'];
html = strrep(html,'$URL$',['"' a '"']); web(['text://' html])
</pre>
<p>Because we don&#8217;t have access to the internals of the web browser, any change from the MATLAB workspace will need a refresh to reflect those values back in the html text. To have your page be a more &#8220;traditional&#8221; dynamic page with HttpRequest or similar mechanism, you&#8217;ll have to deploy your MATLAB code to an actual web server. </p>
<p>If you&#8217;re creative enough you can probably have that sever local, and maybe even the same MATLAB session, but that is beyond my expertise. To get started in that direction, check out our tech note on the subject:<br />
<a href="http://www.mathworks.com/support/tech-notes/1600/1608.html" rel="nofollow"><br />
</a><a href="http://www.mathworks.com/support/tech-notes/1600/1608.html" rel="nofollow">http://www.mathworks.com/support/tech-notes/1600/1608.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roul</title>
		<link>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-4010</link>
		<dc:creator>Roul</dc:creator>
		<pubDate>Thu, 03 Apr 2008 21:10:46 +0000</pubDate>
		<guid>http://blogs.mathworks.com/desktop/2008/02/25/interactive-web-pages-in-matlab-part-3/#comment-4010</guid>
		<description>Suppose i have some web address stored in a variable in matlab. Say g='www.google.com' now i want that there should be a hyperlink created on the web page with the name suppose GOOGLE and when i click this the browser should go to www.google.com. 

The same thing which is done by &#60;a href="www.google.com"}GOOGLE&#60;/a} in html.In the above html tag i've used } instead of greater than symbol because it will be made an acutal link if i do it oherwise.

 Now my problem is how to create a link on web page when the address of the link is stored in a variable in matlab. That is using the above variable g i want to make a hyperlink.</description>
		<content:encoded><![CDATA[<p>Suppose i have some web address stored in a variable in matlab. Say g=&#8217;www.google.com&#8217; now i want that there should be a hyperlink created on the web page with the name suppose GOOGLE and when i click this the browser should go to <a href="http://www.google.com." rel="nofollow">www.google.com.</a> </p>
<p>The same thing which is done by &lt;a href=&#8221;www.google.com&#8221;}GOOGLE&lt;/a} in html.In the above html tag i&#8217;ve used } instead of greater than symbol because it will be made an acutal link if i do it oherwise.</p>
<p> Now my problem is how to create a link on web page when the address of the link is stored in a variable in matlab. That is using the above variable g i want to make a hyperlink.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
