Mann Kendall returns NaN

4 次查看(过去 30 天)
Hi,
I have a column of data. Some of this data has NaN values.
When I exeucte the test using the code
[H1,p_value1] = Mann_Kendall(data, 0.05);
The output returns NaN for the p-value.
This is nonsense.
How can I only apply the test to the numerical data, not the data + NaN values?
This will return an accurate result.
Maybe something like 'omitnan' will work?
Or maybe it is not written into the test code?
Any ideas?
Thanks.

采纳的回答

Ameer Hamza
Ameer Hamza 2020-4-12
Delete the nan values
data(isnan(data)) = [];
[H1,p_value1] = Mann_Kendall(data, 0.05);
or set them to zeros
data(isnan(data)) = 0;
[H1,p_value1] = Mann_Kendall(data, 0.05);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by