how can i multiply two large arrays of different sizes?
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Chunru
le 6 Août 2021
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 commentaires
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!