<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158336</link>
    <title>MATLAB Central Newsreader - How to generate data by Matlab?</title>
    <description>Feed for thread: How to generate data by Matlab?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 25 Oct 2007 20:23:06 -0400</pubDate>
      <title>How to generate data by Matlab?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158336#398442</link>
      <author>Hero Lee</author>
      <description>Dear Sir or Madam,&lt;br&gt;
&lt;br&gt;
I'm just a beginner on Matlab, and would like to generate&lt;br&gt;
data from a function by Matlab.&lt;br&gt;
&lt;br&gt;
The Function is:&lt;br&gt;
Y=f(x1,x2)=[1+(x1)^-2+(x2)^-1.5]^2&lt;br&gt;
where x1 is belonged to [1,5],&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x2 is belonged to [1,5].&lt;br&gt;
&lt;br&gt;
How can I do if I want to generate 200 data from this&lt;br&gt;
function by Matlab. If it's available, could you kindly&lt;br&gt;
describe the codes of Matlab? Really thank you so much.&lt;br&gt;
&lt;br&gt;
Cheers</description>
    </item>
    <item>
      <pubDate>Fri, 26 Oct 2007 00:38:40 -0400</pubDate>
      <title>Re: How to generate data by Matlab?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158336#398457</link>
      <author>Dan Haeg</author>
      <description>&quot;Hero Lee&quot; &amp;lt;hero@mathworks.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;ffqtva$bpk$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Dear Sir or Madam,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I'm just a beginner on Matlab, and would like to generate&lt;br&gt;
&amp;gt; data from a function by Matlab.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The Function is:&lt;br&gt;
&amp;gt; Y=f(x1,x2)=[1+(x1)^-2+(x2)^-1.5]^2&lt;br&gt;
&amp;gt; where x1 is belonged to [1,5],&lt;br&gt;
&amp;gt;       x2 is belonged to [1,5].&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; How can I do if I want to generate 200 data from this&lt;br&gt;
&amp;gt; function by Matlab. If it's available, could you kindly&lt;br&gt;
&amp;gt; describe the codes of Matlab? Really thank you so much.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Cheers&lt;br&gt;
&amp;gt; &lt;br&gt;
does this work?&lt;br&gt;
&lt;br&gt;
Y=@(x1,x2) (1+x1.^-2+ x2.^-1.5).^2;&lt;br&gt;
d = linspace(1,5,200);&lt;br&gt;
[x,y] = meshgrid(d);&lt;br&gt;
&lt;br&gt;
Y(x,y); %here is your 200 x 200 matrix</description>
    </item>
    <item>
      <pubDate>Wed, 16 Jan 2008 01:06:04 -0500</pubDate>
      <title>Re: How to generate data by Matlab?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158336#409563</link>
      <author>Hero Lee</author>
      <description>&quot;Dan Haeg&quot; &amp;lt;haegd@msoe.edu&amp;gt; wrote in message &lt;br&gt;
&amp;lt;ffrcug$qpj$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Hero Lee&quot; &amp;lt;hero@mathworks.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;ffqtva$bpk$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Dear Sir or Madam,&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I'm just a beginner on Matlab, and would like to &lt;br&gt;
generate&lt;br&gt;
&amp;gt; &amp;gt; data from a function by Matlab.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; The Function is:&lt;br&gt;
&amp;gt; &amp;gt; Y=f(x1,x2)=[1+(x1)^-2+(x2)^-1.5]^2&lt;br&gt;
&amp;gt; &amp;gt; where x1 is belonged to [1,5],&lt;br&gt;
&amp;gt; &amp;gt;       x2 is belonged to [1,5].&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; How can I do if I want to generate 200 data from this&lt;br&gt;
&amp;gt; &amp;gt; function by Matlab. If it's available, could you kindly&lt;br&gt;
&amp;gt; &amp;gt; describe the codes of Matlab? Really thank you so much.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Cheers&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; does this work?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Y=@(x1,x2) (1+x1.^-2+ x2.^-1.5).^2;&lt;br&gt;
&amp;gt; d = linspace(1,5,200);&lt;br&gt;
&amp;gt; [x,y] = meshgrid(d);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Y(x,y); %here is your 200 x 200 matrix&lt;br&gt;
&lt;br&gt;
Really sorry for the late reply and I do appreciate your&lt;br&gt;
answer. Yes, it can work well. However, it seems the result&lt;br&gt;
can not fit my requirement perfectly.&lt;br&gt;
&lt;br&gt;
Originally, the outcome should be a &quot;200x3&quot; matrix&lt;br&gt;
(200 examples, 1 output variable, and 2 input variables) &lt;br&gt;
comprising one column of output variable values and two &lt;br&gt;
columns of input variable values, not a &quot;200x200&quot; meshgrid.&lt;br&gt;
&lt;br&gt;
Therefore, how can I generate a 200x3 matrix as follows:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(Output Value) (Input1 Value) (Input2 Value)&lt;br&gt;
Example 1.&lt;br&gt;
Example 2.&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.&lt;br&gt;
Example 200.&lt;br&gt;
&lt;br&gt;
Really Thank you so much.</description>
    </item>
  </channel>
</rss>

