P file is a MATLAB Compiled Program. MATLAB is a high-level language and interactive environment that enables you to perform computationally intensive tasks faster than with traditional programming languages such as C, C, and Fortran. You cannot see the code of a Matlab p-code file. P-code files exists so that one can share code in order that others can't look at it. Type on matlab command window; help p-code file name (if the corresponding.m has comments sections for its inputs and return values, or other documentations, you can probably see them). This time, he has created a tool that allows you to easily deploy your MATLAB files as P-files (protected files). P-files are obfuscated versions of your MATLAB files and are good for hiding the contents of your MATLAB source code. Note, however, that P-files are not encrypted and should not be considered secure. If fun is the name of the m-file then MATLAB will conver the fun.m to fun.p and create it in the same folder. If fun is the name of the folder then MATLAB will convert all the m-files within that folder into p-files. If you want to convert more than one m-file into p-file then use the second code and place all the m-files there.
Convert a function file into a P-file.
In a file named myfunc.m
in your current folder, define a function that returns the square root of a cubic polynomial.
Create a P-file from myfunc.m
. Determine which file MATLAB® uses when you call myfunc
.
Convert selected files from the sparfun
folder into P-files.
Matlab P Code Decompiler
Create a temporary folder and define an existing path to .m
files.
Dead rising 4 codex. Create the P-files.
The temporary folder now contains encoded P-files.
Generate P-files from input files that are part of a class. (The same procedure can be applied to files that are part of a package.) This example uses an existing MATLAB example class.
Define classfolder
as an existing class folder that contains .m
files.
Create a temporary folder. This folder has no class structure at this time.
Create a P-file for every .m
file in the path classfolder
. Because the input files are part of a class, MATLAB creates a folder structure so that the output file belongs to the same class.
The P-file resides in the same folder structure.
Generate P-files in the same folder as the input files.
Copy several .m
files to a temporary folder. Focusrite plugins free.
Create P-files in the same folder as the original .m
files.
Desktop Tools and Development Environment |
Opening and Running Files
Opening Files
You can open a file from the Current Directory browser and the file opens in the tool associated with that file type.
To open a file, select one or more files and perform one of the following actions:
- Press the Enter or Return key.
- Right-click and select Open from the context menu.
- Double-click the file(s).
The file opens in the appropriate tool. For example, the Editor/Debugger opens for M-files, and Simulink opens for model (.mdl
) files.
To open a file in the Editor/Debugger, no matter what type it is, select Open as Text from the context menu. One exception is P-files (.p
), which you cannot open.
To open a file using an external application, select Open Outside MATLAB from the context menu. For example, if you select myfile.doc
, Open Outside MATLAB opens myfile.doc
in Microsoft Word, assuming you have the .doc
file association configured to start Word.
You can also import data from a file. Select the file, right-click, and select Import Data from the context menu. The Import Wizard opens. See the Import Wizard documentation for instructions to import the data.
Function Alternative.Use theopen
function to open a file in the tool appropriate for the file, given its file extension. Default behavior is provided for standard MATLAB file types. You can extend the interface to include other file types and to override the default behavior for the standard files. For name.ext
,Create a temporary folder and define an existing path to .m
files.
Dead rising 4 codex. Create the P-files.
The temporary folder now contains encoded P-files.
Generate P-files from input files that are part of a class. (The same procedure can be applied to files that are part of a package.) This example uses an existing MATLAB example class.
Define classfolder
as an existing class folder that contains .m
files.
Create a temporary folder. This folder has no class structure at this time.
Create a P-file for every .m
file in the path classfolder
. Because the input files are part of a class, MATLAB creates a folder structure so that the output file belongs to the same class.
The P-file resides in the same folder structure.
Generate P-files in the same folder as the input files.
Copy several .m
files to a temporary folder. Focusrite plugins free.
Create P-files in the same folder as the original .m
files.
Desktop Tools and Development Environment |
Opening and Running Files
Opening Files
You can open a file from the Current Directory browser and the file opens in the tool associated with that file type.
To open a file, select one or more files and perform one of the following actions:
- Press the Enter or Return key.
- Right-click and select Open from the context menu.
- Double-click the file(s).
The file opens in the appropriate tool. For example, the Editor/Debugger opens for M-files, and Simulink opens for model (.mdl
) files.
To open a file in the Editor/Debugger, no matter what type it is, select Open as Text from the context menu. One exception is P-files (.p
), which you cannot open.
To open a file using an external application, select Open Outside MATLAB from the context menu. For example, if you select myfile.doc
, Open Outside MATLAB opens myfile.doc
in Microsoft Word, assuming you have the .doc
file association configured to start Word.
You can also import data from a file. Select the file, right-click, and select Import Data from the context menu. The Import Wizard opens. See the Import Wizard documentation for instructions to import the data.
Function Alternative.Use theopen
function to open a file in the tool appropriate for the file, given its file extension. Default behavior is provided for standard MATLAB file types. You can extend the interface to include other file types and to override the default behavior for the standard files. For name.ext
, Matlab P-file Decompiler
open
performs the following actions.File Type | Extension | Action |
---|---|---|
Figure file | fig | Opens figure name.fig in a figure window. |
HTML file | html | Opens HTML file name.html in the MATLAB Web browser. |
M-file | m | Opens M-file name.m in the Editor/Debugger. |
MAT-file | mat | Opens MAT-file name.mat in the Import Wizard. |
Model | mdl | Opens model name.mdl in Simulink. |
P-file | p | Cannot open P-files (pseudocode files that do not expose the M-file code. |
PDF file | pdf | Opens the PDF file name.pdf in the installed PDF reader, for example, Adobe Acrobat. |
Variable | none | Opens the numeric or string array name in the Array Editor; open calls openvar . |
Other | custom | Opens name.custom by calling the helper function opencustom , where opencustom is a user-defined function. |
Use winopen
to open a file using an external application on Windows platforms.
To view the content of an ASCII file, such as an M-file, use the type
function. For example
Matlab P File
displays the contents of the file startup.m
in the Command Window.
Running M-Files
To run an M-file from the Current Directory browser, select it, right-click, and select Run from the context menu. The results appear in the Command Window.
Matlab Run P File
Creating, Renaming, Copying, and Removing Directories and Files | Finding Files and Content Within Files |
© 1994-2005 The MathWorks, Inc.