Is it possible to access simscape to build a physical model from the command line?

2 views (last 30 days)
Hey guys,
I'm working on some CT scan photos in matlab. After some processing steps, I'd like to make an electric circuit by putting resistors at different positions and connect them according to the pattern in the image. To do so, I need to have access to simscape from the matlab command line. It's not a complicated electric circuit. I've got only resistors and the objective is to calculate the equivalent resistance of the whole network. However, I don't know if it's possible to use simscape from command line or not.
Any idea or hint is appreciated. cheers

Answers (1)

Steve Miller
Steve Miller on 10 Apr 2015
Edited: Steve Miller on 10 Apr 2015
Hi bob,
add_line() and add_block() work with Simscape blocks. You can use these to construct your circuit.
Attached to this answer is the file "ML_Build_MyElecModel.m" with MATLAB code that builds a simple electrical circuit. It shows how to add, position, orient, and configure the blocks, as well as how to connect them with Simscape electrical connections. The code also runs the model and plots the results using Simscape logging
There is a submission on the MATLAB Central File Exchange that shows how to use MATLAB to automate the construction of a SimMechanics model. The submission "SimMechanics Model from MATLAB Code" shows how to add blocks and connect them using MATLAB commands. The same commands work for Simscape blocks, too.
Hope this helps!
--Steve

Community Treasure Hunt

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

Start Hunting!