CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2020
    Posts
    1

    Can anyone help me to Run this Matlab simulink file

    Can anyone help me to Run this Matlab simulink file, its very urgent for me to run this mdl file, am getting some errors
    Attached Files Attached Files

  2. #2
    Join Date
    Sep 2020
    Posts
    13

    Re: Can anyone help me to Run this Matlab simulink file

    Use the below code for GUI button:-

    if true
    [filename,pathname] = uigetfile('simulink');% to browse the file
    [pathstr,name,ext]=fileparts(filename) %to get only the name of selected file
    load_system(name)
    cs = getActiveConfigSet(name);
    model_cs = cs.copy;
    global name %Declaring globally so as to use all over the Programm
    sim(name);% to simulate the model
    end

  3. #3
    Join Date
    Jun 2021
    Posts
    10

    Post Re: Can anyone help me to Run this Matlab simulink file

    This MATLAB code shows the commands to run the simulation programmatically. The Simulink.SimulationOuput object get method returns the results and time vector.

    HTML Code:
    mdl = 'vdp';
    load_system(mdl);
    simOut = sim(mdl,'SaveOutput','on',...
       'OutputSaveName','yOut',...
       'SaveTime','on',...
       'TimeSaveName','tOut');
    y = simOut.get('yOut');
    t = simOut.get('tOut');

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured