Matrix multiplication error using '.*'
조회 수: 2 (최근 30일)
이전 댓글 표시
%so this is my simply code
r = randi(100,66);
t = (0:1/55:1);
e = exp(2*pi*i*13*t);
t = r.*e % this gives me error why is it and how can fix
댓글 수: 4
VBBV
2020년 11월 17일
@woodson then you have to divide t into 66. as
%if true
t = 0:1/65:1;
To get what you want.
답변 (3개)
Walter Roberson
2020년 11월 17일
randi(100,66) creates a 66 x 66 matrix of values 1 to 100.
0:1/55:1 is length 56.
When you .* a 66x66 matrix and a 1x56 matrix then what size of output are you expecting?
Andrei Bobrov
2020년 11월 17일
r = randi(100,66);
t = reshape(0:1/55:1,1,1,[]);
e = exp(2*pi*i*13*t);
t = r.*e;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Signal Radiation and Collection에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!