How to invert .p file to .m file

조회 수: 261 (최근 30일)
file123
file123 2018년 2월 13일
답변: Walter Roberson 2023년 8월 29일
I have a file with a .p extension. How can I convert to .m file?
  댓글 수: 2
recent works
recent works 2022년 11월 3일
not possible. only .m files to .p files possible.
Babawuya
Babawuya 2023년 8월 29일
이동: Bruno Luong 2023년 8월 29일
how can i convert a matlab p-code file to m file

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

채택된 답변

ES
ES 2018년 2월 13일
You cant do that.
https://in.mathworks.com/help/matlab/ref/pcode.html
  댓글 수: 5
Steven Lord
Steven Lord 2018년 2월 13일
If you're not sure what your professor has asked you to do, you probably need to ask them to clarify.
From the portion of your assignment that you've quoted, it doesn't sound like your professor wants you to reverse engineer the signal1 function. It sounds like they want you to treat it as a "black box" and write code that uses the signal that black box emits.
Stephen23
Stephen23 2018년 2월 13일
"How can i solve this problem?"
What problem? You can use that .p file without converting it to anything else (that is the whole point of them). The task you were given even tells you exactly how: "To evaluate this function, simply type y = signal1(t) where t is a vector containing values of time".

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

추가 답변 (3개)

recent works
recent works 2022년 11월 3일
not possible. only .m files to .p files possible. mainly .p files helps to protect the important files

Benjamin Kraus
Benjamin Kraus 2018년 2월 13일
By design, there is no way to convert a P-coded file (a file with the .p extension) into a regular MATLAB file (a file with the .m extension). The conversion from MATLAB file to P-coded file is a one-way conversion. As the description on the pcode doc page ("Create protected function file") states, the purpose of creating a P-coded file is to obfuscate the code to protect the source code. If you could reverse the operation, there would be no point in converting to a P-file.

Walter Roberson
Walter Roberson 2023년 8월 29일

There is no documented way to convert p files to m files, and Mathworks will not assist you in converting files.

There have been at least three versions of p files. The first version was in use until about 2010. The second version was in use until a small number of releases ago, and the third version is now in use.

A small number of people outside of Mathworks demonstrated that they were able to convert version 2 p files to m files. None of the people who I was aware of ever provided a commercial service to do the conversion. I was aware of one person who provided a free service, but stopped doing so a number of years ago.

Whether it is legal for people outside Mathworks to convert third-party p files to m files depends on the jurisdiction. In the USA, the encoding done to produce p files would definitely qualify for protection in law, and so in the USA the only people legally permitted to decode third party files would be qualified security researchers, or university students in computer security courses acting under the direction of qualified security researchers — or, people with disabilities who were adapting programs for use with assistive devices for their own personal use (yes, this does mean that if you are someone who physically cannot do the adaptation then you cannot get anyone to do it for you! It is not a good law.)

The laws are different in some other countries, especially Germany, but the relevant laws are mostly driven by entertainment companies (copy protection / digital rights) who have managed to create fairly powerful lobbyists, so the laws are a fair bit more restrictive in many countries than most people would expect.

카테고리

Help CenterFile Exchange에서 Waveform Generation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by