Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

is there a way to implement a for loop in which matrix multiplication is exist?

1 Ansicht (letzte 30 Tage)
saeid k
saeid k am 23 Jul. 2017
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I want to implement a For loop using the Simulink, in which some matrix multiplications exist. The related code is as follows: for i=1:r Y(i,t)=W(:,i,t-1)'*x(:,i,t); can anyany body help me?

Antworten (1)

Andrei Bobrov
Andrei Bobrov am 23 Jul. 2017
ii = 1:r;
t = 2:n;
k = r*(n-1);
Y = reshape(reshape(W(:,ii,t),[],k)'*reshape(x(:,ii,t-1),[],k),r,[]);

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by