How to extract data from cdfplot()
이전 댓글 표시
Hello, allow me inqure something that might be simple but is proving to be a challenge to me. I have this code attached. I would like to extract data from the cdfplot() but I keeop getting errors (error attached below) even after reoving the inf at the end. What can be the problem and how can I avoid it?
A =10*rand(100000,1);
figure()
cdfplot(A)
H = get(gca, 'Children');
x = get(H, 'XData');
y = get(H, 'YData');
xr = 1.24
yr = interp1(x, y, xr)
Error using griddedInterpolant
The coordinates of the input points must be finite values; Inf and NaN are not permitted.
Error in interp1 (line 151)
F = griddedInterpolant(X,V,method);
Error in Epr7errorfunc (line 10)
yr = interp1(x, y, xr)
채택된 답변
추가 답변 (1개)
Shreeya
2024년 10월 8일
0 개 추천
Hello
The error suggests that either zeros/NaN values are being generated in the code due to an arithmetic operation. Applying appropriate conditions to avoid such data points should help mitigate the issue.
Refer to the below MATLAB Answer to understand all the possible reasons resulting in NaN values to help avoid them:
카테고리
도움말 센터 및 File Exchange에서 Spline Postprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!