MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayNew to MATLAB?
MATLAB Central > MATLAB Newsreader > multiplying diag matrix with a reg matrix 

Subject: multiplying diag matrix with a reg matrix From: Balachander Narasimhan Date: 4 Apr, 2009 20:33:01 Message: 1 of 9 
I need to perform the product D*A where D is a diagonal matrix whose diagonal elements are nonzero and A a regular matrix with most of the elements nonzero. Is there is an operation or oneline statement that performs this taking into consideration that D is diagonal instead doing a literal matrix multiplication. This would save a lot of time for me. 
Subject: multiplying diag matrix with a reg matrix From: Bruno Luong Date: 4 Apr, 2009 20:42:01 Message: 2 of 9 
"Balachander Narasimhan" <balxxxxxchand@whatever.com> wrote in message <gr8g5t$gti$1@fred.mathworks.com>... 
Subject: multiplying diag matrix with a reg matrix From: Roger Stafford Date: 4 Apr, 2009 20:48:01 Message: 3 of 9 
"Balachander Narasimhan" <balxxxxxchand@whatever.com> wrote in message <gr8g5t$gti$1@fred.mathworks.com>... 
Subject: multiplying diag matrix with a reg matrix From: Matt Fig Date: 4 Apr, 2009 20:57:01 Message: 4 of 9 
A = round(rand(1000)*10000); 
Subject: multiplying diag matrix with a reg matrix From: Tim Davis Date: 5 Apr, 2009 13:08:01 Message: 5 of 9 
"Matt Fig" <spamanon@yahoo.com> wrote in message <gr8hit$cto$1@fred.mathworks.com>... 
Subject: multiplying diag matrix with a reg matrix From: Matt Fig Date: 5 Apr, 2009 16:00:03 Message: 6 of 9 
"Tim Davis" <davis@cise.ufl.edu> wrote in message 
Subject: multiplying diag matrix with a reg matrix From: Tim Davis Date: 6 Apr, 2009 02:04:01 Message: 7 of 9 
"Matt Fig" <spamanon@yahoo.com> wrote in message <graki3$f5$1@fred.mathworks.com>... 
Subject: multiplying diag matrix with a reg matrix From: Matt Fig Date: 6 Apr, 2009 02:26:03 Message: 8 of 9 
"Tim Davis" <davis@cise.ufl.edu> wrote in message 
Subject: multiplying diag matrix with a reg matrix From: Balachander Narasimhan Date: 6 Apr, 2009 22:01:08 Message: 9 of 9 
hi all, tnx for the replies, that solves my problem. 
No tags are associated with this thread.
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.