How to run a p code matlab?
이전 댓글 표시
I have a list of p codes downloaded online. I need to know how to run these files in Matlab? Thanks for all your help!
채택된 답변
추가 답변 (4개)
Shameer Parmar
2016년 6월 20일
6 개 추천
.p files are the end user code, which we can't see like any other .m files.
to run the .p files, simply keep it in your current directory of matlab,
- Method 1:
Right click on file and select 'run'.
- Method 2:
Simply type the filename on command window (without extension).
- Method 3:
Create one .m file, put names of all .p files (without extension) followed by the semicolon, and then run that .m file.
댓글 수: 2
Sami Ullah
2020년 10월 13일

Facing following error while executing as per your guideline. kindly help
Walter Roberson
2020년 10월 13일
Sami Ullah:
That has nothing to do with p-code.
Satyaki Chaudhuri
2016년 11월 21일
0 개 추천
I came across a very similar situation. You can run them as function files but you got to ""run as administrator" while opening matlab. This enables it to run the .p files as functions.
댓글 수: 2
Walter Roberson
2016년 11월 21일
You should not need "run as administrator" for most of them. It is possible that some might need to make changes to your configuration so you might need to run as administrator. But I have my usual suspicions about code that cannot be seen and which needs to make changes to protected configuration.
Kola Murali
2017년 4월 5일
편집: Walter Roberson
2017년 4월 5일
0 개 추천
The P-code file D:\videos\matlab\matlab\webcamprot\facewebcam.p was generated prior to MATLAB version 7.5 (R2007b) and is no longer supported. Use pcode to regenerate the file using MATLAB R2007b or later.
what can i do
댓글 수: 1
Walter Roberson
2017년 4월 5일
You ask the author of the code to generate a new version for you. There is no way for you to "upgrade" the .p file: it needs to be done by someone who has the original .m that the .p file was created from.
It appears to me that the author was probably Luigi Rosa
Looking around, it appears to me that another alternative would be for you to install R2013a or earlier to run the program. (I am not sure which version exactly was the last one the program could be run with.)
Ila Sharma
2018년 10월 4일
0 개 추천
i couldn't run .p file in Matlab, please help me out
댓글 수: 4
Walter Roberson
2018년 10월 4일
Is there an error message?
Ila Sharma
2018년 10월 4일
yes, in this file one function file named as timebar.p file) is called, and due to .p version it is not running
the error comes as-: Undefined function 'timebar' for input arguments of type 'char'.
Error in SwarmFish_demo_SO_std (line 138) SwarmFish_Procedure_h = timebar('SwarmsLAB::SwarmFish','Total Progress...');
Walter Roberson
2018년 10월 4일
The version of that in the File Exchange is missing files, it appears. There seems to be a complete version at https://onedrive.live.com/?id=A569FA949D5A7AB5%212372&cid=A569FA949D5A7AB5 . I have verified that timebar.p from there works.
Ila Sharma
2018년 10월 4일
thank you very very much sir, now it is running.. Thank you for your time...
카테고리
도움말 센터 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!