<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238903</link>
    <title>MATLAB Central Newsreader - how newff works in matrix?</title>
    <description>Feed for thread: how newff works in matrix?</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>Sun, 09 Nov 2008 09:32:02 -0500</pubDate>
      <title>how newff works in matrix?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238903#609805</link>
      <author>Ning </author>
      <description>newff works well in vectors, how about in matrices?&lt;br&gt;
Here is the code:&lt;br&gt;
%% begin&lt;br&gt;
P=[linspace(0.3,0.1,5);linspace(0.4,0.2,5);linspace(0.5,0.3,5);linspace(0.6,0.4,5)];&lt;br&gt;
T=meshgrid(1:5,1:4);&lt;br&gt;
net = newff(minmax(P),[19,25,4],{'tansig','tansig','purelin'},'trainlm');&lt;br&gt;
net.trainParam.epochs = 1000;&lt;br&gt;
net.trainParam.goal = 0.0001;&lt;br&gt;
net = train(net,P,T);&lt;br&gt;
&amp;nbsp;y1=sim(net,P);&lt;br&gt;
&amp;nbsp;Q=meshgrid(linspace(0.3,0.1,5),1:4);&lt;br&gt;
&amp;nbsp;y2=sim(net,Q);&lt;br&gt;
&amp;nbsp;%% end&lt;br&gt;
&amp;nbsp;In this example, I thought y2(1,:) would be equal or apoximate to y1(1,:),but it's not.&lt;br&gt;
&amp;nbsp;Why? How to modify the code to get it?</description>
    </item>
    <item>
      <pubDate>Mon, 10 Nov 2008 02:30:06 -0500</pubDate>
      <title>Re: how newff works in matrix?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238903#609909</link>
      <author>Ning </author>
      <description>&quot;Ning&quot; &amp;lt;ning.robin@gmail.com&amp;gt; wrote in message &amp;lt;gf6ami$b39$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; newff works well in vectors, how about in matrices?&lt;br&gt;
&amp;gt; Here is the code:&lt;br&gt;
&amp;gt; %% begin&lt;br&gt;
&amp;gt; P=[linspace(0.3,0.1,5);linspace(0.4,0.2,5);linspace(0.5,0.3,5);linspace(0.6,0.4,5)];&lt;br&gt;
&amp;gt; T=meshgrid(1:5,1:4);&lt;br&gt;
&amp;gt; net = newff(minmax(P),[19,25,4],{'tansig','tansig','purelin'},'trainlm');&lt;br&gt;
&amp;gt; net.trainParam.epochs = 1000;&lt;br&gt;
&amp;gt; net.trainParam.goal = 0.0001;&lt;br&gt;
&amp;gt; net = train(net,P,T);&lt;br&gt;
&amp;gt;  y1=sim(net,P);&lt;br&gt;
&amp;gt;  Q=meshgrid(linspace(0.3,0.1,5),1:4);&lt;br&gt;
&amp;gt;  y2=sim(net,Q);&lt;br&gt;
&amp;gt;  %% end&lt;br&gt;
&amp;gt;  In this example, I thought y2(1,:) would be equal or apoximate to y1(1,:),but it's not.&lt;br&gt;
&amp;gt;  Why? How to modify the code to made it?&lt;br&gt;
anybody can help me? just run the code, you'll see the result.</description>
    </item>
    <item>
      <pubDate>Mon, 10 Nov 2008 03:57:12 -0500</pubDate>
      <title>Re: how newff works in matrix?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238903#609918</link>
      <author>Walter Roberson</author>
      <description>Ning wrote:&lt;br&gt;
&amp;gt; &quot;Ning&quot; &amp;lt;ning.robin@gmail.com&amp;gt; wrote in message &amp;lt;gf6ami$b39$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; newff works well in vectors, how about in matrices?&lt;br&gt;
&amp;gt;&amp;gt; Here is the code:&lt;br&gt;
&amp;gt;&amp;gt; %% begin&lt;br&gt;
&amp;gt;&amp;gt; P=[linspace(0.3,0.1,5);linspace(0.4,0.2,5);linspace(0.5,0.3,5);linspace(0.6,0.4,5)];&lt;br&gt;
&amp;gt;&amp;gt; T=meshgrid(1:5,1:4);&lt;br&gt;
&amp;gt;&amp;gt; net = newff(minmax(P),[19,25,4],{'tansig','tansig','purelin'},'trainlm');&lt;br&gt;
&amp;gt;&amp;gt; net.trainParam.epochs = 1000;&lt;br&gt;
&amp;gt;&amp;gt; net.trainParam.goal = 0.0001;&lt;br&gt;
&amp;gt;&amp;gt; net = train(net,P,T);&lt;br&gt;
&amp;gt;&amp;gt;  y1=sim(net,P);&lt;br&gt;
&amp;gt;&amp;gt;  Q=meshgrid(linspace(0.3,0.1,5),1:4);&lt;br&gt;
&amp;gt;&amp;gt;  y2=sim(net,Q);&lt;br&gt;
&amp;gt;&amp;gt;  %% end&lt;br&gt;
&amp;gt;&amp;gt;  In this example, I thought y2(1,:) would be equal or apoximate to y1(1,:),but it's not.&lt;br&gt;
&amp;gt;&amp;gt;  Why? How to modify the code to made it?&lt;br&gt;
&lt;br&gt;
&amp;gt; anybody can help me? just run the code, you'll see the result.&lt;br&gt;
&lt;br&gt;
Well here goes...&lt;br&gt;
&lt;br&gt;
??? Undefined function or method 'minmax' for input arguments of type 'double'.&lt;br&gt;
&lt;br&gt;
Mind you, if it hadn't failed there, it would have failed because it doesn't know what&lt;br&gt;
newff is.&lt;br&gt;
&lt;br&gt;
Looking at your call to 'train', I would suspect that you are trying to use&lt;br&gt;
functions from the Neural Network Toolbox. If so... sorry, the weekend regulars&lt;br&gt;
around here tend not to have the Neural Network Toolbox.&lt;br&gt;
&lt;br&gt;
{Myself, I can't see any reason why y2 should approximate y1 any better than would&lt;br&gt;
have been the case for Q = meshgrid(sort(rand(1,5)),1:4) so it is probably a good&lt;br&gt;
thing that I don't do any NN work! }&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
.signature note: I am now avoiding replying to unclear or ambiguous postings.&lt;br&gt;
Please review questions before posting them. Be specific. Use examples of what you mean,&lt;br&gt;
of what you don't mean. Specify boundary conditions, and data classes and value&lt;br&gt;
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?</description>
    </item>
    <item>
      <pubDate>Mon, 10 Nov 2008 04:26:02 -0500</pubDate>
      <title>Re: how newff works in matrix?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238903#609920</link>
      <author>Ning </author>
      <description>Walter Roberson &amp;lt;roberson@hushmail.com&amp;gt; wrote in message &amp;gt; &lt;br&gt;
&amp;gt; Well here goes...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ??? Undefined function or method 'minmax' for input arguments of type 'double'.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Mind you, if it hadn't failed there, it would have failed because it doesn't know what&lt;br&gt;
&amp;gt; newff is.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Looking at your call to 'train', I would suspect that you are trying to use&lt;br&gt;
&amp;gt; functions from the Neural Network Toolbox. If so... sorry, the weekend regulars&lt;br&gt;
&amp;gt; around here tend not to have the Neural Network Toolbox.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; {Myself, I can't see any reason why y2 should approximate y1 any better than would&lt;br&gt;
&amp;gt; have been the case for Q = meshgrid(sort(rand(1,5)),1:4) so it is probably a good&lt;br&gt;
&amp;gt; thing that I don't do any NN work! }&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
As inputs, Q(1,:) = P(1,:), therefore if the net relationship was built, y1(1,:) would be equal to or approximate y2(1,:). So the wrong result probably attributed to the failed net building?</description>
    </item>
    <item>
      <pubDate>Wed, 12 Nov 2008 18:09:27 -0500</pubDate>
      <title>Re: how newff works in matrix?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238903#610530</link>
      <author>Greg Heath</author>
      <description>On Nov 9, 11:26=A0pm, &quot;Ning&quot; &amp;lt;ning.ro...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Walter Roberson &amp;lt;rober...@hushmail.com&amp;gt; wrote in message &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Well here goes...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; ??? Undefined function or method 'minmax' for input arguments of type '=&lt;br&gt;
double'.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Mind you, if it hadn't failed there, it would have failed because it do=&lt;br&gt;
esn't know what&lt;br&gt;
&amp;gt; &amp;gt; newff is.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Looking at your call to 'train', I would suspect that you are trying to=&lt;br&gt;
&amp;nbsp;use&lt;br&gt;
&amp;gt; &amp;gt; functions from theNeuralNetwork Toolbox. If so... sorry, the weekend re=&lt;br&gt;
gulars&lt;br&gt;
&amp;gt; &amp;gt; around here tend not to have theNeuralNetwork Toolbox.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; {Myself, I can't see any reason why y2 should approximate y1 any better=&lt;br&gt;
&amp;nbsp;than would&lt;br&gt;
&amp;gt; &amp;gt; have been the case for Q =3D meshgrid(sort(rand(1,5)),1:4) so it is pro=&lt;br&gt;
bably a good&lt;br&gt;
&amp;gt; &amp;gt; thing that I don't do any NN work! }&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; As inputs, Q(1,:) =3D P(1,:), therefore if the net relationship was built=&lt;br&gt;
, y1(1,:) would be equal to or approximate y2(1,:). So the wrong result pro=&lt;br&gt;
bably attributed to the failed net building&lt;br&gt;
&lt;br&gt;
The inputs to net are column vectors, not row vectors.&lt;br&gt;
&lt;br&gt;
Also, reexamine your usage of linspace and meshgrid&lt;br&gt;
&lt;br&gt;
help linspace&lt;br&gt;
help meshgrid&lt;br&gt;
&lt;br&gt;
Hope this helps.&lt;br&gt;
&lt;br&gt;
Greg</description>
    </item>
  </channel>
</rss>

