which simulink blocks can I use to create the function below ??
Afficher commentaires plus anciens
Please which simulink blocks can I use to create the function below ?
fsolve(@(XY)anothertrial(xy,A,B,P1,P2),XY0)
Where A,B, P1 and P2 are variables that will be provided by the results of calculations in other blocks, and XY0 is the value of the guess for the function fsolve.
Réponse acceptée
Plus de réponses (2)
grapevine
le 20 Fév 2012
0 votes
You can use either the block Matlab fcn in the "user-defined function" library either a sfunction.
I suggest you to use the first one, in this way you just need to write your function inside a m file and put it as argument of the block
for further details take a look to the doc http://www.mathworks.nl/help/toolbox/simulink/ug/f6-106261.html
7 commentaires
kamal kiki
le 20 Fév 2012
grapevine
le 21 Fév 2012
you can define them as global in the workspace or if you prefere you can pass these variables as input (mux) 2 the Matlab fcn block, in this way your "u" will be a vector
good luck
kamal kiki
le 21 Fév 2012
grapevine
le 22 Fév 2012
as I said in this way your "u" will be a vector in the Matlab fcn and you can refer to your parameters as
u(1)=A
u(2)=B
......
kamal kiki
le 22 Fév 2012
grapevine
le 23 Fév 2012
u should not use the embedded matlab function 'cause it limited u should use the MATLAB Function block as I told u
u have to change the name of the associated Matlab function, for default it's sin u have to write the name of your mfile where you wrote your function
good luck
kamal kiki
le 23 Fév 2012
rupa
le 21 Mai 2013
0 votes
i am trying to generate PWM by watching the video from youtube, i am unable to use fcn block as they have used in the video , i am getting an error stating Warning: Using a default value of 0.2 for maximum step size. The simulation step size will be equal to or less than this value. You can disable this diagnostic by setting 'Automatic solver parameter selection' diagnostic to 'none' in the Diagnostics page of the configuration parameters dialog .
please some1 help me solving this .
Best regards,
1 commentaire
Kaustubha Govind
le 21 Mai 2013
Modifié(e) : Kaustubha Govind
le 21 Mai 2013
This warning has nothing to do with the Fcn block, it is simply complaining that you have not set a "maximum step size" in the Configuration Parameters window's Solver pane. If you'd like to ignore the warning, you can disable it by following the directions in the warning message.
(Btw, this is a warning, not an error, so you should still be able to simulate and obtain your result)
Catégories
En savoir plus sur Discontinuities 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!