Comments for Guy on Simulink https://blogs.mathworks.com/simulink Guy Rouleau is an Application Engineer for MathWorks. He writes here about Simulink and other MathWorks tools used in Model-Based Design. Fri, 17 Nov 2023 15:34:15 +0000 hourly 1 https://wordpress.org/?v=6.2.2 Comment on Creating Your Own Block With Continuous States (MATLAB S-Function) by Yohan https://blogs.mathworks.com/simulink/2012/06/25/creating-your-own-block-with-continuous-states-matlab-s-function/#comment-274334 Tue, 15 Oct 2019 21:06:06 +0000 https://blogs.mathworks.com/seth/?p=962#comment-274334 Hello!

I am trying to use a S-function to solve a set of nonlinear coupled differential equations (continuous states), for example:

xdot(1)=x(2)+xdot(2);
xdot(2)=-(g/l)*x(1)-(c/J)*x(2)+(1/J)*u;
sys=xdot;

But i got the following error: Error inexemplo/S-Function’ while executing MATLAB S-function ‘exemplo’, flag = 1 (derivatives), at time 0.0.
Undefined function or variable ‘xdot’. This is because I’m calling xdot(2) in derivative xdot(1), here we have the coupled nature of the problem. Can you help me to solve this problem? Is it possible to do this with S-functions?

]]>
Comment on Getting the most out of Rapid Accelerator mode by Dominik Smentek https://blogs.mathworks.com/simulink/2015/03/19/getting-the-most-out-of-rapid-accelerator-mode/#comment-269374 Fri, 20 Sep 2019 08:31:18 +0000 https://blogs.mathworks.com/seth/?p=4486#comment-269374 Hi,
great work. It worked for me wonderfully. But I have problems to change 2D-lookup-tables with this command:

paramSet(i) = Simulink.BlockDiagram.modifyTunableParameters(rtp, ‘k’, k_values(i));

So, let’s say k is a matrix. Is this possible?

]]>
Comment on Curling Game Update: App Designer and Stateflow by Jesus Zambrano https://blogs.mathworks.com/simulink/2019/09/06/curling-game-update-app-designer-and-stateflow/#comment-267308 Wed, 11 Sep 2019 02:31:22 +0000 https://blogs.mathworks.com/simulink/?p=9112#comment-267308 Hi Guy,
Very nice app! Thanks for sharing it!

I just got one error during the running, it happens when selecting “Rotation” equal to 2 or -2:

Error using matlab.ui.control.internal.model.AbstractInteractiveTickComponent/set.Value (line 95)
‘Value’ must be a double scalar within the range of ‘Limits’.
Error in curlingLogic>EMFunction:shoot (line 344)

With a “Rotation” inside those boundaries, the app runs without any problem.

]]>
Comment on Time to Convert to Variant Subsystems by Prakash https://blogs.mathworks.com/simulink/2013/03/18/time-to-convert-to-variant-subsystems/#comment-266300 Fri, 06 Sep 2019 10:06:01 +0000 https://blogs.mathworks.com/seth/?p=1977#comment-266300 Hi! I have the same querry as the comment 9 above. Is it replied somewhere?

]]>
Comment on Simulating models in parallel made easy with parsim by Guy Rouleau https://blogs.mathworks.com/simulink/2017/04/14/simulating-models-in-parallel-made-easy-with-parsim/#comment-264548 Wed, 28 Aug 2019 13:12:47 +0000 https://blogs.mathworks.com/simulink/?p=6393#comment-264548 @Jake Hannafious: Your code should run fine. I recommend contacting technical support. One thing you could check is the output of “which -all parsim” to be sure there is no other file named “parsim” on your path.

We would also like to understand the performance issue. Thos should be equivalent.

]]>
Comment on Simulating models in parallel made easy with parsim by Lauri Berkovits https://blogs.mathworks.com/simulink/2017/04/14/simulating-models-in-parallel-made-easy-with-parsim/#comment-264500 Wed, 28 Aug 2019 09:33:04 +0000 https://blogs.mathworks.com/simulink/?p=6393#comment-264500 Can you collect the Matlab console output if you use parsim? I don’t mean the output that parsim itself gives, I mean the output from fprintf etc. which I usually collect with ‘diary’. How about breakpoints? Can you use Matlab editor’s breakpoints (For Matlab Systems in a Simulink model) together with parsim?

]]>
Comment on Overview Of Recent Projects Features by Sean de Wolski https://blogs.mathworks.com/simulink/2019/08/15/overview-of-recent-projects-features/#comment-262022 Fri, 16 Aug 2019 13:13:55 +0000 https://blogs.mathworks.com/simulink/?p=9070#comment-262022 What’s my favorite feature? Easy – dependency and impact analysis. It’s a great way to begin understanding a code base and to safely make updates to it.

]]>
Comment on I can’t believe it took me 6 months to find that! by Matthias Schwaiger https://blogs.mathworks.com/simulink/2013/02/13/i-cant-beleive-it-took-me-6-months-to-find-that/#comment-260554 Tue, 06 Aug 2019 15:59:37 +0000 https://blogs.mathworks.com/seth/?p=1883#comment-260554 Another nice options would be:
– close all subsystems
– move tab to new window
– duplicate tab
– …
on a right-click menu on the tab itself – as any other great tool does!

]]>
Comment on Mask Initialization and Self-Modifying Blocks by Maricarmen Hernández https://blogs.mathworks.com/simulink/2008/08/21/mask-initialization-and-self-modifying-blocks/#comment-259436 Tue, 30 Jul 2019 18:06:06 +0000 https://blogs.mathworks.com/seth/2008/08/21/mask-initialization-and-self-modifying-blocks/#comment-259436 Hi! I am developing a model where the idea is created and connect block according to the number in the mask, I have my code but I need to delete everything to create the blocks and connections, my problem is when I want to simulate all the connections disappear and I think is because I delete using Simulink.SubSystem.deleteContents(blk) to delete the whole Subsystem, there is a command that applies the changes only if the button apply? thanks

]]>
Comment on How Many Blocks are in that Model? by harini https://blogs.mathworks.com/simulink/2009/08/11/how-many-blocks-are-in-that-model/#comment-257538 Wed, 17 Jul 2019 10:37:08 +0000 https://blogs.mathworks.com/seth/2009/08/11/how-many-blocks-are-in-that-model/#comment-257538 How can I find count blocks in an atomic subsystem in that subsystem level?

]]>