Problem in the initFcn callback of model

2 views (last 30 days)
Albert Hao
Albert Hao on 18 Apr 2019
Edited: Honglei Chen on 18 Apr 2019
Hi, everyone. I am a student from China, so plz forgive me for my poor English. I have a problem while using the callback funtion of Simulink. I found an example of the FMCW radar in the Mathwork(https://ww2.mathworks.cn/help/phased/examples/automotive-adaptive-cruise-control-using-fmcw-and-mfsk-technology.html?searchHighlight=FMCW&s_tid=doc_srchtitle). I want to do some changes to this example to meet my need. Firstly I saved this example as another name in another path, then I rewrite the initial function of this model which has the same name with the old initial function. 1555556626(1).jpg
However, I found though i had changed the initial function, the model still use the old function. If I change the name of the function, the system told me it can't find the function. I don't know why. Please help me solve it,

Answers (1)

Honglei Chen
Honglei Chen on 18 Apr 2019
Edited: Honglei Chen on 18 Apr 2019
When you say that you rewrote the init function, did you overwrite it? If so, it should use the same one. You can certainly rename the function and then call the new function name in the callback instead. The fact that MATLAB complains about not finding the function seems to suggest that your helper function is not on the path. Did you run the model from where you saved those files?
HTH

Community Treasure Hunt

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

Start Hunting!