too many input arguments
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Elie Elias
am 6 Nov. 2018
Kommentiert: Stephen23
am 6 Nov. 2018
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 Kommentare
Akzeptierte Antwort
Stephen23
am 6 Nov. 2018
Bearbeitet: Stephen23
am 6 Nov. 2018
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 Kommentare
Stephen23
am 6 Nov. 2018
"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:
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!