how can i multiply two large arrays of different sizes?
조회 수: 6 (최근 30일)
이전 댓글 표시
I'm trying to figure out how to get a value for k when I have two variables w and t that are of different sizes.
sigma = 0 %can set sigma to any positive integer number but choosing 0 to simplify things for now
w = (0:2*pi:30000*pi) % required parameters
z = sigma + 1i.*w %gives me a complex array of 1x15001 using the values of w above.
dt=1/44000; %my sample rate is 44000
t = 0:dt:2 %gives me an array of 1x88001
k = exp(-z.*t); %this is where my problem comes in because i can't multiply two arrays of different sizes
댓글 수: 0
답변 (1개)
Chunru
2021년 8월 6일
sigma = 0 %can set sigma to any positive integer number but choosing 0 to simplify things for now
w = (0:2*pi:10*pi) % required parameters (small value for illustration)
z = sigma + 1i.*w %gives me a complex array of 1x15001 using the values of w above.
dt=1/44000; %my sample rate is 44000
t = 0:dt:4*dt; %gives me an array of 1x88001 (smaller size)
% k is a matrix k(i_z, i_t). I guess this is what you want
k = exp(-z.'*t)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!