Forum

Notifications
Clear all

2021 Day 5: Error in displayStats function


Rachel Romeo
Posts: 3
Customer
Topic starter
(@rachelromeo)
New Member
Joined: 8 months ago

Hello, 

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)
obj =
obj.validateAndAssignLabels(newLabels,indices,fullAssignment,fixDups,fixEmpties,fixIllegal);

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)',
output.misc.hmrstatsG_base_cond.pval(Hb,lst_thresh)']...

 

Any help appreciated. Thanks!

5 Replies
Meryem Yücel
Posts: 124
Admin
(@mayucel)
Estimable Member
Joined: 2 years ago

I assume you did setpaths to homer directory right?

Reply
1 Reply
Rachel Romeo
Customer
(@rachelromeo)
Joined: 8 months ago

New Member
Posts: 3

@mayucel Yes, and I just closed everything and tried again with the same problem.

Reply
Meryem Yücel
Posts: 124
Admin
(@mayucel)
Estimable Member
Joined: 2 years ago

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?

Reply
Rachel Romeo
Posts: 3
Customer
Topic starter
(@rachelromeo)
New Member
Joined: 8 months ago

This could be it! I have 2017 (I thought that was the recommended version for Homer). -- What version would you recommend?

Reply
Meryem Yücel
Posts: 124
Admin
(@mayucel)
Estimable Member
Joined: 2 years ago

2017 is good for homer. This script does not belong to homer, and only written for your convenience for today's lecture's demo. 

Reply
Share:
en_USEnglish