dot product in 3d
3 次查看(过去 30 天)
显示 更早的评论
I am trying to convert 2d dot product below to 3d.
Nk=100
Ne=5
for i=1:Nk
for j=1:Ne
exp(i,j)=dot(Q(j,:),v_y(i,:))
where Q is 5*5 transition matrix and v_y is 100*5 matrix
Nk=100
Ne=5
Nz=3
for i=1:Nk
for j=1:Ne
for k=1:Nz
exp(i,j,k)??
end
end
end
where v_y is 100*5*3 matrix and Z will be a transition matrix 3*3
2 个评论
回答(1 个)
KSSV
2022-2-7
Nk=100
Ne=5
Nz=3
for k = 1:Nz
for i=1:Nk
for j=1:Ne
exp(i,j,k) = dot(Q(j,:,k),v_y(i,:,k)) ;
end
end
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!