How to find the x value from cumsum
显示 更早的评论
Hi, I plotted a cumulative sum in Matlab. Is there any where for me to get the value of x from the plot(value of y is known)?
采纳的回答
更多回答(3 个)
Jan
2012-12-21
It depends on what you exactly want...
Actually the X-values are trivial:
data = rand(1, 100);
y = cumsum(data);
lineH = plot(y);
% Now the X-values are:
x = 1:numel(y);
% You can obtain them explicitly:
x2 = get(lineH, 'XData');
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!