Cannot load MATLAB file properly
显示 更早的评论
load Data_USYieldCurve
% Extract data for the last day of each month
MonthYearMat = repmat((1990:2010)',1,12)';
EOMDates = lbusdate(MonthYearMat(:),repmat((1:12)',21,1));
MonthlyIndex = find(ismember(Dataset.Properties.ObsNames,datestr(EOMDates)));
Estimationdataset = Dataset(MonthlyIndex,:);
EstimationData = double(Estimationdataset);
When I was trying to run this code, it always gives me the warning:
Variable 'Dataset' originally saved as a dataset cannot be instantiated as an object and will be read in
as a uint32.
which leads me unable to access 'Dataset' properly with dot index.
I understand it's because the definition for the object's class is not available to MATLAB. And it has something to do with my add-on toolbox? I am using Financial Toolbox and Financial Instrument Toolbox.
Could any help me solve this error or recommend me a toolbox that works.
Thanks a lot!
回答(1 个)
Rik
2019-3-23
1 个投票
The dataset class is part of the Statistics (and Machine Learning) Toolbox according to the doc. So you will either need to re-implement it yourself, or get that toolbox.
Also, it would be wise to heed the warning at the top of that page. The benefit of moving to a table (as suggested) is that you don't need any toolbox to work with those. The table data type was introduced in R2013b, so unless you need extreme backwards compatability (for something between R2007a and R2013b), you should seriously consider moving.
2 个评论
Le Zhao
2019-3-23
Rik
2019-3-23
It shows that warning in the R2018b doc. I don't know if it will be removed in R2019a, but if you're not using the prerelease the class should still be there. Are you sure you installed the toolbox correctly?
I don't have a suggestion how to convert your dataset object to a table, as I have never worked with dataset, nor have I a lot of experience with the table data type. I would think the best solution will also depend on the kind of data you want to store.
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!