<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/153771</link>
    <title>MATLAB Central Newsreader - Fill a matrix</title>
    <description>Feed for thread: Fill a matrix</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The 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>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 01 Aug 2007 06:58:44 -0400</pubDate>
      <title>Fill a matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/153771#385836</link>
      <author>Flavio Eripi</author>
      <description>Is there any command to put the values outside the diagonal of a matrix?&lt;br&gt;
For example if I want this matrix:&lt;br&gt;
a= [1,5,5,5;&lt;br&gt;
5,1,5,5;&lt;br&gt;
5,5,1,5;&lt;br&gt;
5,5,5,1];&lt;br&gt;
Thank you&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 01 Aug 2007 07:36:38 -0400</pubDate>
      <title>Re: Fill a matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/153771#385837</link>
      <author>us</author>
      <description>Flavio Eripi:&lt;br&gt;
&amp;lt;SNIP stitching numbers...&lt;br&gt;
&lt;br&gt;
one of the many(!) solutions&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m=ones(4);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m(~eye(size(m)))=5;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m&lt;br&gt;
&lt;br&gt;
us&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 01 Aug 2007 07:47:56 -0400</pubDate>
      <title>Re: Fill a matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/153771#385838</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;f8pav4$pv1$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
Flavio Eripi &amp;lt;didad30@libero.it&amp;gt; wrote:&lt;br&gt;
&amp;gt;Is there any command to put the values outside the diagonal of a matrix?&lt;br&gt;
&amp;gt;For example if I want this matrix:&lt;br&gt;
&amp;gt;a= [1,5,5,5;&lt;br&gt;
&amp;gt;5,1,5,5;&lt;br&gt;
&amp;gt;5,5,1,5;&lt;br&gt;
&amp;gt;5,5,5,1];&lt;br&gt;
&amp;gt;Thank you&lt;br&gt;
&lt;br&gt;
V = 5;&lt;br&gt;
a = magic(4);&lt;br&gt;
&lt;br&gt;
cols = size(a,1);&lt;br&gt;
a(~eye(cols)) = V;&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;There are some ideas so wrong that only a very intelligent person&lt;br&gt;
&amp;nbsp;&amp;nbsp;could believe in them.                              -- George Orwell&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
