How to invert .p file to .m file

166 次查看(过去 30 天)
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 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by