How to include a P-File in Simulink?

조회 수: 10 (최근 30일)
wkm42
wkm42 2016년 6월 1일
편집: Shivam 2025년 1월 15일
Hey, I'm trying to include a P-file into my Simulink model, but unfortunately it doesn't work. The File needs 2 inputs and generates 1 output. I tried to use the MATLAB Function Block to simply call the P-File:
function y = fcn(m,n)
y = p_file(m,n)
But I receive the error:
P-file '' is not authorized for compilation. To support compilation, please consider using 'coder.allowpcode' in this file. When the file defines a MATLAB class, 'coder.allowpcode' should be added to the class constructor.´
So how can i solve it if i can't edit the P-File and add 'coder.allowpcode'?
Thank you for any suggestions!

답변 (1개)

Walter Roberson
Walter Roberson 2016년 6월 1일
It is not the P-File that you would edit: it would be the .m file that is used to generate the .p file.
If you cannot edit the .m file and regenerate the .p file, then you cannot use the .p file in any of the accelerated modes, only in the very basic Normal mode.
  댓글 수: 2
wkm42
wkm42 2016년 6월 1일
편집: wkm42 2016년 6월 1일
Even in Normal Mode i can't run the model. So i guess it's impossible, because i can't edit the .m file..
Shivam
Shivam 2025년 1월 15일
편집: Shivam 2025년 1월 15일
I want to understand more about the Pcode concept , can you recommend best sources to understand and use it.

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

카테고리

Help CenterFile Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by