Matlab2014a pcode and functions: cannot generate pcode due to input argument error?

조회 수: 2 (최근 30일)
Emma
Emma 2014년 9월 18일
댓글: Greg 2016년 3월 18일
When I attempt to pcode any function, however basic the same error message appears 'Not enough input arguments' this error occurs the first time any input argument to the function is used. If I attempt to write a function without any arguments and pcode it, it returns the error 'Input argument must be a nonempty string.'
Again, I must emphasise that the functions themselves work, and return no error messages. The only time error messages appear is when I attempt to pcode them.
I have just updated from 2006b (yes I know very old!) so I need to redo all of my previous pcodes in this version but cannot! Any help would be MUCH appreciated.
  댓글 수: 7
Steven Lord
Steven Lord 2016년 3월 18일
PCODE requires the NAME of the function from which the p-coded file is to be generated as input. In your first attempt you're calling main2048 with the variable dataset as input and attempting to use whatever it returns as the name of the file to pass into PCODE. In your second attempt you're calling main2048 with no input arguments and attempting to use whatever that returns as the name of the file.
Try:
pcode('main2048')
Greg
Greg 2016년 3월 18일
Ignore above. I wasn't using the correct call. It should be:
pcode main2048
This worked fine.
jgn

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

답변 (3개)

Andreas Goser
Andreas Goser 2014년 9월 18일
It might be you have something other called pcode on your path. Please execute
which pcode -all
It should return only something like this
C:\Program Files\MATLAB\R2014a\toolbox\matlab\general\pcode.m
If you have more, you know which function or variable casues the trouble.
  댓글 수: 1
Emma
Emma 2014년 9월 18일
Thank you, but unfortunately I have tried this and there is only one pcode on the path!

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


Iain
Iain 2014년 9월 18일
I know this is probably obvious, but you are using "pcode" correctly?
pcode filename
or
pcode('filename')
  댓글 수: 1
Emma
Emma 2014년 9월 19일
Thank you- the obvious ones are sometimes the answers! My syntax was correct however I have tried changing my function names to all lower case and this seems to work. It may just have been my computer!

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


Jaco
Jaco 2014년 12월 2일
I get the same error when using pcode. If I rename my file to all lower case it still gives the same error?? I'm using 2014b
  댓글 수: 1
Andreas Goser
Andreas Goser 2014년 12월 3일
Please provide the information asked by Philip and I:
"Post the exact commands you are typing and errors you get and example of a function you are attempting to pcode and even the .p file you have produced by pcoding it."
and
which pcode -all

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

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by