How can I export my Simulink electrical circuit into a Matlab function?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1481286/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1481286/image.png)
0 comentarios
Respuestas (1)
Joel Van Sickel
el 18 de Sept. de 2023
Editada: Joel Van Sickel
el 18 de Sept. de 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 comentarios
Ver también
Categorías
Más información sobre Simscape Electrical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!