Errors while running adaptive cruise control model from website

I have used the code provided by them but i'm getting the following error.
Error evaluating 'InitFcn' callback of MPC block (mask) 'mpcACCsystem/Adaptive Cruise Control System/MPC'. Callback string is 'impcblock_InitFcn'
Caused by:
  • Can not resolve: mpcobj.

 Accepted Answer

It requires the MPC toolbox. Do you have it? run
ver mpc
license inuse

9 Comments

yes, i do have the tool box
MATLAB Version: 9.6.0.1072779 (R2019a)
MATLAB License Number: 192331
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 18362)
Java Version: Java 1.8.0_181-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
Model Predictive Control Toolbox Version 6.3 (R2019a)
control_toolbox
matlab
simulink
The weblink is for R2020a. But I followed it in R2019a. No errors.
oh ok, even i'm using R2019a. Dont know where i'm making mistake
Run "license inuse" after that error to see if you do have the MPC license active.
Re-start MATLAB, try again starting from the addpath() command in the weblink.
The mpc license is not active after the error
so what is the exact output of "license inuse" after that error?
license inuse
control_toolbox
matlab
simulink
I think that is the cause of the problem/error. You have the MPC toolbox installed but you couldn't check out a license for MPC. Your license is probably served on a license server. For whatever reason, you couldn't check it out. The code in the callback is trying to create a MPC object. If no error, the "license insue" should return those plus "mpc_toolbox".
Figure out the license issue, license('checkout','mpc_toolbox') and license('test','mpc_toolbox') might be useful.

Sign in to comment.

More Answers (0)

Products

Release

R2019a

Tags

Community Treasure Hunt

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

Start Hunting!