<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/241776</link>
    <title>MATLAB Central Newsreader - A problem about  sparse matrix</title>
    <description>Feed for thread: A problem about  sparse 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>Thu, 01 Jan 2009 12:39:02 -0500</pubDate>
      <title>A problem about  sparse matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/241776#619460</link>
      <author>zedong </author>
      <description>I now have a matrix  It's a matrix I want to do the following thing:&lt;br&gt;
A is a sparse  matrix.for example n by n&lt;br&gt;
rowcolumindex is an vector which store some index of A.My code is like this:&lt;br&gt;
A(rowcolumindex,:)=0;&lt;br&gt;
A(rowcolumindex,rowcolumindex)=speye(length(rowcolumindex));%You can understand I want to set the rows rowcolumindex be a eye matrix.&lt;br&gt;
But I find it's no efficiency.Because after the first row code that A(rowcolumindex,:) now become a full matrix,I think. Am I right?Any efficiency implementation</description>
    </item>
    <item>
      <pubDate>Thu, 01 Jan 2009 14:30:04 -0500</pubDate>
      <title>Re: A problem about  sparse matrix</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/241776#619469</link>
      <author>Matt </author>
      <description>&quot;zedong &lt;br&gt;
&quot; &amp;lt;zdongwu@gmail.com&amp;gt; wrote in message &amp;lt;gjidh6$e25$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I now have a matrix  It's a matrix I want to do the following thing:&lt;br&gt;
&amp;gt; A is a sparse  matrix.for example n by n&lt;br&gt;
&amp;gt; rowcolumindex is an vector which store some index of A.My code is like this:&lt;br&gt;
&amp;gt; A(rowcolumindex,:)=0;&lt;br&gt;
&amp;gt; A(rowcolumindex,rowcolumindex)=speye(length(rowcolumindex));%You can understand I want to set the rows rowcolumindex be a eye matrix.&lt;br&gt;
&amp;gt; But I find it's no efficiency.Because after the first row code that A(rowcolumindex,:) now become a full matrix,I think. Am I right?Any efficiency implementation&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I would prefer to do it this way:&lt;br&gt;
&lt;br&gt;
complement=1:n; &lt;br&gt;
complement(rowcolumnindex)=[];&lt;br&gt;
&lt;br&gt;
Anew=speye(n);&lt;br&gt;
Anew(:,complement)=A(complement,:).'; %filling columns of sparse matrices is faster.&lt;br&gt;
Anew=Anew.';</description>
    </item>
  </channel>
</rss>

