Matlab parameters change when i run simulink model?

2 views (last 30 days)
Hi there,
As part of a uni coursework we have had to create a model of a vehicle drivetrain. I have done this in simulink and fairly sure it is correct as i got the answer i recieved. Then based on experimental data i used the parameter estimation in Simulink to tune the parameters. I then updated said parameters in the original Matlab parameter file. However, when I then go to rerun the simulation the parameters I've updated change back to their original values. Could someone please help me stop this, it's driving me mad :P
Kind regards,
Matthew
  2 Comments
Divya Yerraguntla
Divya Yerraguntla on 6 Jan 2020
Hi Matthew,
Could you check if you ran the MATLAB parameter file after updating the parameters in the file and before running the SIMULINK model because if the MATLAB workspace is'nt updated with the new parameter values then iy will keep using the old values from workspace.
Matthew Price
Matthew Price on 6 Jan 2020
Hi Divya,
Thank you for your reply. I had updated the parameter file and the model with the updated parameters but then when i ran the SIMULINK model it still changed the parameters back. After playing around with it for several hours, I realised I just have changed the parameter file name at some point and the SIMULINK model was still drawing parameters from the original file. I've changed the name of the file back to the original and put the parameter file and model in its own folder and it seems to have worked since. Thank you very much for your time though.
Regards,
Matthew

Sign in to comment.

Answers (1)

Matthew Price
Matthew Price on 6 Jan 2020
Hi Divya,
Thank you for your reply. I had updated the parameter file and the model with the updated parameters but then when i ran the SIMULINK model it still changed the parameters back. After playing around with it for several hours, I realised I just have changed the parameter file name at some point and the SIMULINK model was still drawing parameters from the original file. I've changed the name of the file back to the original and put the parameter file and model in its own folder and it seems to have worked since. Thank you very much for your time though.
Regards,
Matthew

Categories

Find more on Simulink in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!