Execution of script nchoosek as a function is not supported

10 views (last 30 days)
David
David on 26 Apr 2022
Commented: Stephen23 on 27 Apr 2022
I am trying to use the nchoosek function and I get this error "Execution of script nchoosek as a function is not supported".
I am entering:
b = nchoosek(5,4)
Thanks for any help!
  1 Comment
John D'Errico
John D'Errico on 26 Apr 2022
Please don't use an answer to make a comment and a followup to the answer you got.

Sign in to comment.

Answers (1)

Bruno Luong
Bruno Luong on 26 Apr 2022
Edited: Bruno Luong on 26 Apr 2022
Please do that
which nchoosek
/MATLAB/toolbox/matlab/specfun/nchoosek.m
you must find somewhere similar to the above or this
C:\Program Files\MATLAB\R2022a\toolbox\matlab\specfun\nchoosek.m
You probably shadow the stock function (get different result).
  3 Comments
Stephen23
Stephen23 on 27 Apr 2022
"When I enter "which nchoosek" I get the current file path."
That does not sound good: do you have a script named NCHOOSEK ? What is the current path?
Please show us what this command prints:
which nchoosek -all

Sign in to comment.

Categories

Tags

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by