Undefined function 'trend' for input arguments of type 'double'
1 次查看(过去 30 天)
显示 更早的评论
Hai everyone, i facing some problem with the script. I'm using trend function but had an error like this
Undefined function 'trend' for input arguments of type 'double'.
Error in script_msl_v2 (line 14)
ud=trend(data{:,4:end},[],2,'omitnan');
with this script
clear;
clc;
format longG;
f = dir('D:/full_Data_Cryosat_c2p0004.txt');
A=1:length(f);
D = f(A).name;
ff=D(:,19:25)
data=readtable(D,'HeaderLines',0);
rata2=mean(data{:,4:end},2,'omitnan');
standar_deviation=std(data{:,4:end},[],2,'omitnan');
ud=trend(data{:,4:end},[],2,'omitnan');
ref=data{:,1};
lat=data{:,2};
lon=data{:,3};
msl=[ref lat lon rata2 standar_deviation]
file_name_msl=['msl_' ff '.txt']
dlmwrite(file_name_msl, rata2, 'delimiter', '\t');
file_name_data=['data_msl_' ff '.txt']
dlmwrite(file_name_data, msl, 'delimiter', '\t','precision',10);
What should i do to solve that?
Thanks for helping
0 个评论
回答(1 个)
Dave B
2021-10-23
If you're trying to use a function you got from elsewhere (e.g. downloaded from file exchange) you likely need to add the directory containing that function to the MATLAB path. For an easy graphical interface for managing the path, just run: pathtool
If you're expecting trend to be a builtin function in MATLAB, I think it's not...what were you expecting it to do?
which trend
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!