How can I plot cornering stiffness using GUI ?
Afficher commentaires plus anciens
Hello Everyone
I am Koushik, a young automotive engineering graduate with keen interest in vehicle dynamics.I have just started learning MATLAB on my own.I wanted to create a plot for Cornering stiffness of a Tyre ( Lateral Force Vs Slip Angle).So,I created a GUI and I am struggling to plot the graph.I have attached the .m file and the .fig file for your reference.Kindly guide me on plotting this.
Réponses (1)
Adam
le 27 Mai 2015
You can use e.g.
handles.Fz = str2double(get(hObject,'String'));
in your callback (e.g. the Fz0_Callback)
then in your plot callback use
handles.Fz
instead of just variables that don't exist in the scope of the plot function.
Or in the plot function you can get the values directly from the ui controls using the same manner, but without needing to save them on the handle struct.
2 commentaires
Adam
le 2 Juin 2015
There are a few things wrong with this piece of code:
if alphay>0
sign(alphay)= 1;
else
sign(alphay)= -1;
- You are using alphay as an array index despite it not being an integer (as the error says).
- You are overwriting (or hiding, rather) a builtin function by assigning to an array called 'sign'.
- The builtin function that you are overwriting would give exactly the answer you want if you were to simply call it where needed rather than trying to re-implement it yourself by assigning values to an array.
If you were to just remove the above lines of code then the call to sign(alphay) on the subsequent line should work fine by calling the builtin function rather than an array you are trying to create to hide the function.
Catégories
En savoir plus sur Simulink Functions dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!