How can I export my Simulink electrical circuit into a Matlab function?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I've drawn the following electrical circuit and it's working really well. The thing is that I need to test multiple discrete values of some of the parameters like Load, Ground Resistance, and Length of conductors.
Ideally, I wish to define a function in MATLAB which as input it takes something like Rg, P1, Q1, L and as output it would give me the values of voltages and currents. It would be a [V1, V2, I1, I2] = my_circuit(Rg, P1, P2, Q1, Q2]
Ignore the shortcircuit block.
I don't even know if it possible. Can anyone point me on the right direction?
Thanks in advance
0 commentaires
Réponses (1)
Joel Van Sickel
le 18 Sep 2023
Modifié(e) : Joel Van Sickel
le 18 Sep 2023
The easiest approach to this would be to utilize the sim() command. This lets you set parameters, run a simulation and then get results. You can then take it to the next step and do things like generating code from the model but the sim() command is the quickest easierst way to do it and doesn't require any of the coder or compiler products.
0 commentaires
Voir également
Catégories
En savoir plus sur Switches and Breakers dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!