Coding Circuits in Matlab

19 views (last 30 days)
Ibrahim Ben Mrad
Ibrahim Ben Mrad on 28 Mar 2022
Answered: Prasanna Konyala on 31 Mar 2022
Hello everybody,
Im just getting started with Matlab. Can someone tell me how to write a code of a Resistor for example or a small electrical circuit consisting of two in series Resistors so the plot can be done in Simulink
thx in advance!

Answers (1)

Prasanna Konyala
Prasanna Konyala on 31 Mar 2022
Hi Ibrahim
From my understanding, you want to create a circuit with resistors in series.
To find the equivalent resistance you can use sum() (as the sum of resisters is the equivalent resistance in series connection).
If you want to design and implement and simulate the circuits, I suggest you try Simscape Electrical toolbox. It makes the process simpler than writing whole code in Matlab.
You can leverage plot in matlab or scope in Simscape for plotting

Community Treasure Hunt

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

Start Hunting!