How to perform cumulative product on a discrete signal in Matlab
1 view (last 30 days)
Show older comments
I tried to perform cumulative product on a discrete signal. But it keeps throwing errors. Am not sure how to go about it.
Here's my code:
function [i_o,q_o] = Accumulate(I, Q)
cumprod = dsp.CumulativeProduct;
i_o = cumprod(I);
q_o = cumprod(Q);
Thanks
3 Comments
Steven Lord
on 2 Jun 2020
What is the full and exact text of the error messages you receive when you run your code? Show us all the text displayed in red in the Command Window when you run your Accumulate function.
Answers (1)
Sai Sri Pathuri
on 9 Jul 2020
How did you call the function? I assume you didn't pass input arguments
It must be called with input arguments, like
%
% Code to find (or) define I, Q
%
[i_o,q_o] = Accumulate(I, Q); % Call the function with input arguments
%
% Code using i_o, q_o
%
function [i_o,q_o] = Accumulate(I, Q)
cumprod = dsp.CumulativeProduct;
i_o = cumprod(I);
q_o = cumprod(Q);
end
0 Comments
See Also
Categories
Find more on Spectral Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!