too many input arguments

조회 수: 2 (최근 30일)
Elie Elias
Elie Elias 2018년 11월 6일
댓글: Stephen23 2018년 11월 6일
Im using prctile() to find the 70th percentile of 1300 elements, but matlab returns error too many input arguments. How can i fix this? Thanks
  댓글 수: 8
Elie Elias
Elie Elias 2018년 11월 6일
still too many arguments
Elie Elias
Elie Elias 2018년 11월 6일
i tried to do
v=zeros(size(TM,1),1);
v=cell2mat(TM{:,7})
but it still says Too many input arguments

댓글을 달려면 로그인하십시오.

채택된 답변

Stephen23
Stephen23 2018년 11월 6일
편집: Stephen23 2018년 11월 6일
The first input to prctile must be numeric (double or single). So your cell array will need to be converted to numeric. You wrote that TM is a cell array, but you have not given us any description of how the data is arranged inside that cell array. This makes it hard to help you, as we have to guess.
If TM is a cell array that contains scalar numeric data in each cell of the seventh column, then try this:
prctile(cell2mat(TM(:,7)),70)
  댓글 수: 2
Elie Elias
Elie Elias 2018년 11월 6일
oh it works thanks but why does this work and not prctile(cell2mat(TM{:,7}),70)?
Stephen23
Stephen23 2018년 11월 6일
"oh it works thanks but why does this work and not prctile(cell2mat(TM{:,7}),70)?"
Because using curly braces creates a comma-separated list. Read these to know more:

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by