Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Matrix divide in Simulink

221 views
Skip to first unread message

Daniel Alexander

unread,
Dec 10, 2009, 3:57:24 PM12/10/09
to
Hi,
I'm trying to divide the columns of a 3x6 matrix by the elements of a row vector (1x6) to obtain again a 3x6 matrix. In Matlab, I use a simple loop function to do this operation and it works fine but how to I perform the same calculation in Simulink using blocks. I tried the block ''matrix multiply' which can also do diviation in combination with two input blocks, one inputting the 3x6 matrix and the other the row vector but so far no success. Can you help?

Thanks in advance
Daniel


SimSim

unread,
Dec 11, 2009, 11:14:55 PM12/11/09
to
If this is what you are trying to do:
a=randn(3,6)
b=randn(1,6)
c=repmat(b,[3,1])
out = a./c;

you can use Divide block and use a and c as inputs to the Divide block. If b comes from another block (instead of a source block) you can use Matrix concatenate block to form c.

SimSim
prudent.programmingATgmailDOTcom

0 new messages