How to make matrix dimensions equal?

Size of x is 99*1000
Size of win is 1000*1
How to make both x and win the same dimension
Y=x.*win

2 个评论

why you want to make same dimension? Each column of x is same as win.
I am getting an error that the dimensions are not equal

请先登录,再进行评论。

回答(1 个)

Maybe you want this
%-----Example-------------
x=rand(99,1000)
win=rand(1000,1)
%---------------------------
out=bsxfun(@times,x,win')

类别

帮助中心File Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by