Effacer les filtres
Effacer les filtres

'meanci' and 'predci' problem

5 vues (au cours des 30 derniers jours)
Cornelis
Cornelis le 28 Juin 2011
Is there a problem with the meanci and predci statistics in the grpstats function?
I can't get these to work and Evaluating the grpstats example (see : http://www.mathworks.com/help/releases/R2010b/toolbox/stats/grpstats.html)
load carsmall
[m,p,g] = grpstats(Weight,Model_Year,...
{'mean','predci','gname'})
n = length(m)
errorbar((1:n)',m,p(:,2)-m)
set(gca,'xtick',1:n,'xticklabel',g)
title('95% prediction intervals for mean weight by year')
results in:
??? Subscripted assignment dimension mismatch.
Error in ==> repmat at 54
B(nelems) = A;
Error in ==> grpstats at 297
z = repmat(t1,[ngroups,cols,1]); % one per group and col
Suggestions are much appreciated
many thanks Kind regards Cornelis

Réponses (1)

Aaron Powers
Aaron Powers le 12 Jan 2016
I tried this code out in 2014b and 2016a prerelease, and I did not receive an error -- the example ran correctly. I was unable to get access to the 2010 version of MATLAB that you may have been using. To me it looks like this problem is not visible in newer versions of MATLAB.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by