matlab and simulink

Use of simout function combined with simulink in MATLAB

The simout function is able to assign the variable of the m file to the variable in simulink, so that if you want to change the parameters, you can only use the m file to change, you don't need to calculate the variable and then write the data in simulink, examples are as follows

A simple sinusoidal amplitude gain simulation, the gain is p, and the m file is

a=1;
b=2;
p=a*2+b*2;
simout=sim('k');
The file name of simulink is k, and the parameters of a and b can be directly used to directly adjust the size of gain p in simulink.

The results are as follows;

Sine source signal

After adding the gain p to the signal, the above code calculates p to be 6, and accordingly, the sinusoidal amplitude becomes 6 times.



Source: CSDN
Original: https://blog.csdn.net/akirattc/article/details/86602059

Related:

Matlab GUI and simulink mixed calling and parameter passing

[Matlab] Matlab GUI and simulink mixed call and parameter transfer

Intelligent Recommendation

Matlab/Simulink STM32 development

Original link: Today I accidentally saw this blog write and use【Matlab/Simulink+STM32CubeMX】Tools for the development of STM32, I can’t help but sigh that Matlab’s functions are indeed too...

Matlab simulink modeling and simulation

Matlab simulink modeling and simulation 1 Initial simulink 1.1 Introduction to simulink 1.1.1 The relationship between matlab and simulink 1.1.2 What is simulink 1.1.3 Two ways to open simulink 1.2 Pr...

MATLAB Simulink Usage and Examples

MATLAB Simulink Usage and Examples Today we will create a new simulink file as shown in the figure The source code has been uploaded, it only takes 5 points to download it, hehe. . Create a new Simuli...

Simulink foundation of MATLAB

##MATLAB's Simulink foundation Through the previous study, we have mastered the basic operation and analysis methods of MATLAB script and GUI. Today we will talk about another tool in MATLAB-Simulimk....

[Matlab/Simulink] PMSM module

Simulink comes with PMSM module 1.Configuration (configuration) 1.1 Number of phases 1.2Back EMF waveform 1.3Rotor Type 1.4Mechanical input 1.5Preset model 2. Parameters (parameter settings) 2.1Stator...

More Recommendation

Iterative operations in Matlab Simulink

The iterative operation is required during Simulink under Simulink, so it has been a method and rule of a small experimental test Simulink. Need to useUNITDELAY module+MATLAB FUNCTION module Experimen...

MATLAB - SIMULINK Toolbox (1)

Usage of Matlab-Simulink Toolbox (1) SIMULINK Open mode and basic operation method The SIMULINK toolbox is MATLAB to model, simulate and analyze software packages for dynamic systems. It provides a gr...

Initialization of Matlab Function in SIMULINK

Increase in the next line of the Function header%#codegenSymbols, its role is to make a static code analyzer Code Analyzer diagnostic code and prompting users to fix the illegal ways to cause errors i...

MATLAB Delete Annotation in Simulink

MATLAB Delete Annotation in Simulink Get the location of the Annotation by the Find_System function; Use the Get_Param function to get the ANNOTATION specific annotation content. Some of the following...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top