simulink

Simulink Mask Parameters

二次信任 提交于 2019-12-13 00:19:31
问题 I'm trying to create a subsystem that has a transfer function in it. Everything except one coefficient in the denominator is set in this transfer function. How can I promote only this parameter, instead of promoting the entire denominator of the transfer function into the the subsystem's mask? When the user double clicks on the sub system, I want to make it so the mask only requests this single parameter, rather than the whole denominator. Is this possible? It's a third order system: [1

solve second order ODE in MATLAB/SIMULINK

自闭症网瘾萝莉.ら 提交于 2019-12-12 21:37:50
问题 I don't know how to solve this second order ODE in SIMULINK: I rewrote it to the system of first order ODEs: then giving My SIMULINK blocks are here: giving this Scope: This is the plot of symbolic solution from dsolve : It looks like the functions (plots) from symbolic and SIMULINK are little similar. 回答1: The solution was found by Phil Goddard . His answer in comments: In Simulink you are plotting y_dot, while the symbolic solution is a plot of y. So the problem was that Scope was plotting

How can I call an m file in Simulink and put it to a block in my model?

北城以北 提交于 2019-12-12 17:07:18
问题 How can I call an m file in Simulink and put it to a block in my model (without using an S function)? Does anybody have an idea? I'd really appreciate it. 回答1: If you're trying to apply a user-defined MATLAB function to Simulink signals, there are a few different ways to do this, depending on your objective. All options are available within the User-Defined Functions section of the Simulink library. Use the MATLAB function block if you intend to generate code from your model. This block does

How to access to C global variable structure by Python and ctype [duplicate]

牧云@^-^@ 提交于 2019-12-12 09:27:27
问题 This question already has an answer here : Mapping a global variable from a shared library with ctypes (1 answer) Closed 3 years ago . I have to integrate python with external so library . Unfortunately, the C code uses a global variable SimpleTest_Y (structure) and I need to access it in order to modify the value(s). Here the C code SimpleTest.c file #include "SimpleTest.h" /* External inputs (root inport signals with auto storage) */ ExtU_SimpleTest_T SimpleTest_U; /* External outputs (root

Downloading Matlab Support Package Raspberry Pi

[亡魂溺海] 提交于 2019-12-12 06:15:40
问题 I'm trying do download the MATLAB Raspberry Pi Support Package, but can't finish it due to an error occuring every time. I can go through every step until I put the sd card back to my Raspberry Pi and use an ethernet cable to connect the Pi with my PC. Whenever Matlab tries to detect my Raspberry Pi, it throws an error message: "attempt to reference field of non-structure array." What does this mean? Information about my PC: Windows 7, i7 processor, 64 bit, 8 GB RAM MATLAB R2014a Raspberry Pi

Why can't I tune tunable parameter “L” for block “Series RLC branch”?

[亡魂溺海] 提交于 2019-12-12 06:15:23
问题 I made exe file from Simulink model (I used rsim, tunable parameter on). Before this i made a standalone application with exe file that had block "constant" and everything worked great. I used "rsimgetrtp" and followed mr.Phil advices. But now when I need to make a more complex exe simulation with GUI i get warning that says some parameters can't be tunable. "Warning: Reducing expression 'Lk' in parameter field 'Inductance' of 'sestpulsni/Lk3' to its numerical equivalent because this field is

How to input double values in Simulink from Workspace?

淺唱寂寞╮ 提交于 2019-12-12 04:53:37
问题 I need to do a very basic operation of adding two numbers in Simulink. The values are stored as variables in the workspace. The 'From Workspace' block seems to take either Timeseries or structures as input. I am not sure how to convert the data to do this basic operation. 回答1: You can use a Constant blocks and use the name of the variable as the value. 回答2: If your "numbers" are parameters - that is they do not vary with time - use Constant blocks. If they are variables or signals - i.e. they

How to set 'Target Hardware' in Simulink Embedded Coder from a script?

限于喜欢 提交于 2019-12-12 02:35:23
问题 I have a Simulink project with a lot of sub-projects. I have different environments for which I need to generate code from Simulink. So I am trying to set the Target Hardware from a MATLAB script. I can change other settings just fine, but I don't know how the name of the Target Hardware parameter so I can use set_param(). I have searched for it, but can't seem to find it and it appears that there isn't one. models = {'Model1','Model2','Model2'}; for i=1:length(models) open(char(models(i)));

How to write S-function with variable size of output signal?

依然范特西╮ 提交于 2019-12-12 02:08:51
问题 I want to write a block, which sends all image files from selected directory. Images are of different sizes, so output signal size should vary. Unfortunately I was unable to find a way to change signal size at each step. There are many of undocumented features here, in examples like block.OutputPort(1).DimensionsMode = 'Variable'; and block.OutputPort(1).CurrentDimensions = [1 block.InputPort(1).Data]; and so on. I was unable to deduce correct way to operate all this stuff yet... UPDATE For

Simulink numerical evaluation to prevent overflow

蓝咒 提交于 2019-12-12 01:34:09
问题 I have this function f(a,b) = { a*a/b if a < b, b if a >= b } defined for values of a and b between 0 and 1 inclusive. The function is continuous at all valid values of a and b in this range. (Really! try it yourself!) But I'm not sure how to evaluate it in Simulink. The problem is that I can't figure out how to restate it in a way that I could evaluate both "forks" of the function and take the min or max (e.g. min(a*a,b*b)/b ) without having a divide-by-zero error at b=0 , and I'd like to