Errors while running adaptive cruise control model from website
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
I an trying to run Adaptive Cruise control model from https://www.mathworks.com/help/mpc/ug/adaptive-cruise-control-using-model-predictive-controller.html
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
Fangjun Jiang
on 24 Apr 2020
It requires the MPC toolbox. Do you have it? run
ver mpc
license inuse
9 Comments
Dhanush Sureshbabu
on 24 Apr 2020
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
Fangjun Jiang
on 24 Apr 2020
The weblink is for R2020a. But I followed it in R2019a. No errors.
Dhanush Sureshbabu
on 24 Apr 2020
oh ok, even i'm using R2019a. Dont know where i'm making mistake
Fangjun Jiang
on 24 Apr 2020
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.
Dhanush Sureshbabu
on 24 Apr 2020
The mpc license is not active after the error
Fangjun Jiang
on 24 Apr 2020
so what is the exact output of "license inuse" after that error?
Dhanush Sureshbabu
on 24 Apr 2020
license inuse
control_toolbox
matlab
simulink
Fangjun Jiang
on 24 Apr 2020
Edited: Fangjun Jiang
on 24 Apr 2020
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.
Dhanush Sureshbabu
on 24 Apr 2020
thank you for your help
More Answers (0)
Categories
Find more on Controller Creation in Help Center and File Exchange
Tags
See Also
on 24 Apr 2020
on 24 Apr 2020
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)