Matrix/Array Multiplication problem in Simulink

조회 수: 8 (최근 30일)
Odiri Oghre
Odiri Oghre 2011년 4월 26일
답변: Anisleidy Gonzalez 2019년 11월 1일
Hi Guys,
I desperately need help resolving a matrix/array multiplication problem in simulink. I have a dynamic system - a channel model precisely built in simulink and wish to implement the following matrix/array multiplication:
a(i,j,k)*b(j,k);
Can some please advise how to get this done.
Many thanks.
Odiri

채택된 답변

Kaustubha Govind
Kaustubha Govind 2011년 4월 26일
Use the Product block from the Simulink->Math Operations library and set "Multiplication" parameter to "Matrix(*)".
  댓글 수: 3
Odiri Oghre
Odiri Oghre 2011년 4월 26일
I have even tried using the array vector multiplier to no avail.
Kaustubha Govind
Kaustubha Govind 2011년 4월 26일
Sorry about that - I missed the part about 'a' being a 3D array. One way of doing this is to iterate through 'a' by using the Iterated Assignment (look for section on http://www.mathworks.com/help/toolbox/simulink/slref/assignment.html) block inside a For Iterator subsystem, to get each a(i,:,:) which should be a 2D matrix. Now you can use the Product block to perform element-wise multiplication (not matrix multiplication as previously suggested) between a(i,:,:) and b.
Regarding your other question about not being able to import n-D signals using From Workspace block, note that you need to define the workspace variable either as a "Structure with Time" or Simulink.Timeseries object.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Anisleidy Gonzalez
Anisleidy Gonzalez 2019년 11월 1일
You can use the Hadamart product, changing the dimensions of the 2D matrix or the best option is transforming the 3D matrix to a tensor and use the tensor toolbox

카테고리

Help CenterFile Exchange에서 Array and Matrix Mathematics에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by