Trouble using zscore function

조회 수: 4 (최근 30일)
Elizabeth Mahoney
Elizabeth Mahoney 2018년 6월 19일
편집: TED MOSBY 2024년 10월 18일
I am having trouble using the zscore function. I am getting the error:
Error using mean Too many input arguments.
Error in zscore (line 43) mu = mean(x,dim);
Even when I use the example from https://www.mathworks.com/help/stats/zscore.html I get this error.
load lawdata
[Z,gpamean,gpastdev] = zscore(gpa)
Does anyone know how I can fix this?

답변 (1개)

TED MOSBY
TED MOSBY 2024년 10월 10일
편집: TED MOSBY 2024년 10월 18일
Hi Elizabeth,
I ran the two lines of code you provided below, and they didn't throw any errors for me.
load lawdata
[Z,gpamean,gpastdev] = zscore(gpa)
Additionally check:
  • Ensure that there is no custom implementation of mean that is overshadowing the built-in MATLAB function. You can check this by running:
which mean -all
  • It's possible that your MATLAB path is altered and causing the issue. You can restore the default MATLAB path by executing:
restoredefaultpath;
rehash toolboxcache;
  • Try running your script in a clean MATLAB session without any additional toolboxes or custom scripts loaded.
Hope this helps!

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by