multiplication between vectors

Hi everybody,
I have a problem with my program in matlab. I get an error about a multipication between vectors. I print the size of each vetor:
===========S(1:win_size, i)========= 256 1
==========x(offset(i):offset(i)+win_size-1)======== 1 256
========window======== 256
========x(offset(i):offset(i)+win_size-1) .* window====== ??? Error using ==> times Matrix dimensions must agree.
Error in ==> myspecgram at 107 S(1:win_size, i) = x(offset(i):offset(i)+win_size-1) .* window;
How can I fix this error?
Thanks, Ashraf

1 件のコメント

per isakson
per isakson 2012 年 6 月 10 日
Please markup!

サインインしてコメントする。

回答 (2 件)

per isakson
per isakson 2012 年 6 月 10 日

0 投票

".* " is element wise multiplication. Is that what you want? If so the vectors must have identical sizes or one must be a scalar.
Walter Roberson
Walter Roberson 2012 年 6 月 11 日

0 投票

If x is a row vector and window is a column vector then you cannot use .* to multiply the two together.
Consider making x a column vector to be the same as your other variables.

カテゴリ

ヘルプ センター および File ExchangeOperators and Elementary Operations についてさらに検索

質問済み:

2012 年 6 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by