There is no data field because you saved the array using the name Xs. So you need to use the field Xs (and get rid of the superfluous parentheses):
tmp = load(strcat(folder,'\',dname,'_Xs.mat'));
If you want the variable in the new mat file to be named data, then you need to name it data (and not Xs).
1 Comment
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/711713-how-to-properly-extract-dataset-and-load-in-new-file-keep-getting-error#comment_1251693
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/711713-how-to-properly-extract-dataset-and-load-in-new-file-keep-getting-error#comment_1251693
Sign in to comment.