Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to write this equation?....want optimized code?

조회 수: 1 (최근 30일)
Dhines
Dhines 2013년 2월 18일
마감: MATLAB Answer Bot 2021년 8월 20일
http://latex.codecogs.com/gif.latex?W=\Sigma%20_{k}{\alpha%20_{k}}y_{k}x_{k}
here...alpha is 7x1 matrix(7 elements). 'y' limit is 10x1(10 elements). 'x' limit is 7x50(350 elements).

답변 (1개)

Walter Roberson
Walter Roberson 2013년 2월 18일
The formula you give only makes sense if alpha, y, and x, are all the same length, in which case it would be
sum( alpha .* y .* x )
Otherwise the subscript k makes no sense.
Your arrays are also not the proper size in the proper order in order for matrix multiplication to be intended. (y * alpha transpose * x) could work for matrix multiplication (in which case the multiplication would produce 10 x 50), but then the summation would not make sense. And besides, the order in the equation is not right.

이 질문은 마감되었습니다.

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by