Support : Knowledge base

Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Loading…

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-01320// Views: AA-01320// Created: 2017-09-03 20:43:19// Last Updated: 2017-09-11 04:09:51
Problem & Solution
Toolboxes paths not kept in the MATLAB "set path" after restart

Problem

Some OPAL-RT or XILINX toolboxes are missing from the Simulink library browser, which can also generate "bad links" in the model.

The associated paths are missing as well from the MATLAB "Set path" window. Adding these paths solves temprorarily the problem, but as soon as MATLAB is restarted, the paths are lost again.

How to correct this ?

Solution

This problem comes from a lack of privileges on the computer when setting the paths. MATLAB does not allow to save these paths, thus generating the bad links

1) Open MATLAB from RT-LAB and type the command

>> userpath

It should return something like

'C:\Users\\Documents\MATLAB'

We are calling this the USERPATH.


2) Type the command

>> matlabroot

It should return something like 

C:\MATLAB\R2015ASP1

or

C:\Program Files\MATLAB\R2015SP1

We are calling this the MATLABROOT.


3) From folder MATLABROOT\toolbox\local, copy the file 'pathdef.m' and paste it into the USERPATH. This file contains the paths defined in the Set Path window

4) Copy the attached file 'startup.m' in the USERPATH. This will tell MATLAB to use the 'pathdef.mfile located in the USERPATH

5) Edit the 'startup.m' file and complete line 4: replace the tag by the USERPATH value, i.e. you can write something like:

pathdir = 'C:\Users\\Documents\MATLAB';

6) Save and close 'startup.m'

7) From MATLAB (again, the instance opened from RT-LAB), add the desired paths (using the Set Path window or any M-File provided with RT-LAB), and save.

8) Close and reopen MATLAB from RT-LAB

9) Check that the paths are there.

10) If the paths are there, you can Edit the model from RT-LAB, there should be no more bad links

startup.m 350 b 350 b