Create a MATLAB only project and connect to the P4 Server
Before you create a MATLAB only project, you must:
- create a .p4config file in the root directory of your project/work area.
- create your client workspace Directories on your machine where you work on file revisions that are managed by P4 Server. using a Perforce client. For instructions on how to create a client workspace in the P4V visual client or the P4D command line client, see Creating and managing workspaces or p4client respectively.
The following steps will create a .p4config file for the project, create a new MATLAB project, and connect the project to the P4 Server.
Create a new MATLAB only project and connect to the P4 Server:
- In the root directory of your project/work area, create a .p4config file with values for P4USER, P4PORT, and P4CLIENT .
- When P4 for MATLAB and Simulink has connected to the P4 Server, the P4 Server will request a password if it is required.
- MATLAB automatically picks up the P4 Server configuration when you navigate the files on your system.
- Your project is now connected to the P4 Server. For details of the P4 Server file and folder operations available to you, see File management.
These three values are enough for the P4 for MATLAB and Simulink plugin to connect to the P4 Server.
Example .p4config file:
P4USER=username
P4PORT=helixcoreserver:1666
P4CLIENT=workspacename
If P4 AS is configured for your P4 Server a web page will open and you will be directed to the sign in process used by your Identity Provider (IdP) when you connect to the P4 Server.
If the specified workspace does not exist, P4 for MATLAB and Simulink will try to create it by prompting you for a depot path. The client root will be set to the sandbox root (given in the Simulink project creation window).
A default view is created, where DEPOT_PATH is the path entered at the prompt, and CLIENT_NAME is the specified workspace name:
//DEPOT_PATH/... //CLIENT_NAME/...