Why this message appears?
조회 수: 1 (최근 30일)
이전 댓글 표시
clear all;
f1=200;
f2=250;
a1=1;
a2=1.5;
fe=10e3;
temps=0:1/fe:0.02-1/fe;
m1=a1*sin(2*pi*f1*temps);
m2=a2*sin(2*pi*f2*temps);
mt=m1*m2;
Error using *
Inner matrix dimensions must agree.
댓글 수: 0
채택된 답변
Star Strider
2019년 5월 1일
It appears because you are multiplying two row vector using matrix mulktiplication.
You need to use element-wise array multiplication (using .* instead of *):
mt = m1 .* m2;
댓글 수: 10
Star Strider
2019년 5월 4일
As always, my pleasure.
I took the ‘n’ out of the fft call entirely. I was not certain where you wanted to put the ‘n’, or what you wanted to do with it. If ‘n’ is the same as the size as the time-domain vector, using it as the size of the fft does not change anything, because the length of the time-domain vector is the default length of the fft for that vector.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Measurements and Spatial Audio에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!