Need help for explanation of one command
Show older comments
This is part of code
x = zeros(size(y)); % Making a row vector x which is having length equal to y and all contents of x are 0.
*x(1:length(ADSR)) = ADSR;* %----> What this line is doing, I know it is padding zeros but what is logic for that
Accepted Answer
More Answers (2)
Daniel Shub
on 23 Sep 2011
0 votes
If ADSR is of length N and y is of length M, then at the end, x will have at least length N (and possibly length M) depending on if N is greater or less then M. Now as for why you might want to pad zeros on ADSR, you haven't provided nearly enough information.
Jan
on 23 Sep 2011
0 votes
You know, what happens, and you ask, what the logic for it is. The question is not clear. Obvious any part in the program needs, that X contains the vector ADSR and some zeros to have the same length as y.
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!