2021 Day 5: Error in displayStats function
I am unable to run Meryem's displayStats function. The DEMO.mat output looks fine, but I get a series of errors:
>> displayStats('DEMO.mat', 1, 0.05, 0)
Error using matlab.internal.tabular.private.varNamesDim.makeValidName (line 498)
'Source#' is not a valid variable name.
Error in matlab.internal.tabular.private.varNamesDim/validateAndAssignLabels (line 383)
[newLabels,wasMadeValid] = obj.makeValidName(newLabels,exceptionMode);
Error in matlab.internal.tabular.private.tabularDimension/setLabels (line 173)
Error in matlab.internal.tabular.private.tabularDimension/createLike_impl (line 355)
obj = obj.setLabels(dimLabels,);
Error in matlab.internal.tabular.private.varNamesDim/createLike (line 76)
obj = obj.createLike_impl(dimLength,dimLabels);
Error in tabular/initInternals (line 212)
t.varDim = t.varDim.createLike(nvars,varnames); % error if invalid, duplicate, or empty
Error in table.init (line 332)
t = t.initInternals(vars, numRows, rowLabels, numVars, varnames);
Error in array2table (line 64)
t = table.init(vars,nrows,rownames,nvars,varnames);
Error in displayStats (line 44)
T = array2table([ml(lst_thresh,1), ml(lst_thresh,2), tval(lst_thresh)',
Any help appreciated. Thanks!
I assume you did setpaths to homer directory right?
Hi Rachel, another participant also mentioned the same issue. I think it is MATLAB version related. array2table is a matlab function (which is called by the script), and the error is related to that function. The array2table may have been modified in the later versions of MATLAB. Mine is 2019b where it worked. The other participant had 2017, what is your matlab version?
This could be it! I have 2017 (I thought that was the recommended version for Homer). -- What version would you recommend?
2017 is good for homer. This script does not belong to homer, and only written for your convenience for today's lecture's demo.