问题标签 [simulink]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
854 浏览

matlab - How do I change Simulink xPC target serial comm speed on the fly

I have an xPC target application that talks to a device over RS-232. I am using the xPC serial block for this.
To talk to this device I first have to start at a default speed, say, 9600 bps, request a change of speed to, say 57600 bps, then change the speed on my side to match it.
The problem with the xPC block is that it forces you to choose a specific speed before running, and can't change it at run time. Is there a way/trick/hack to do this?

0 投票
3 回答
1185 浏览

matlab - Running a Simulink xPC block at a faster rate than the continuous rate

I have a Simulink xPC target application that has blocks with discrete states at several different sample rates and some sections using continuous states. My intention on keeping the continuous states is for better numerical integration.

What creates the problem: One block is reading a device at a very fast rate (500 hz). The rest of the application can and should run at a slower rate (say, 25 or 50 Hz) because it would be overkill to run it at the highest rate, and because the processor simply cannot squeeze a full application cycle into the .002 secs of the faster rate. So I need both rates. However, the continuous states run by definition in Simulink at the faster discrete rate of the whole application! This means everywhere I have continuous states now they're forced to run at 500 Hz when 25 Hz would do!

Is there a way to force the continuous states in xPC target to a rate that is not the fastest in the application? Or alternatively, is there a way to allow certain block to run at a faster speed than the rest of the application?

0 投票
6 回答
1386 浏览

matlab - 什么是 MATLAB?它会生成可执行文件吗?

究竟什么是MATLAB/Simulink?我试图理解它,但在这个过程中只会变得更加困惑。

我知道您可以使用高级行业特定功能和算法编写程序,但是:

  • 它是一个运行时,您可以将代码“构建”到客户端/服务器的可执行程序中吗?
  • 它只是一个模拟环境,如LabVIEW,不能用于生产软件/硬件吗?
  • 它是一个代码生成软件,比如编译器-编译器本身并不真正执行代码吗?
0 投票
2 回答
1005 浏览

matlab - Simulink version of AnyLogic component

Does anybody know what components in Simulink (MATLAB package) are analogs for AnyLogic components? (e.g: source, buffer, delay, sink). Or how can I easily simulate behavior of AnyLogic model in MATLAB? Maybe there are some cool magic tools?

0 投票
6 回答
5551 浏览

matlab - 建模和仿真编程语言

我使用许多不同的模型和模拟。一些较旧的模型和模拟是用 FORTRAN 编写的。其中一些模型已转换为 C++,但当前趋势是使用 MATLAB/SIMULINK 创建这些模型。从计算机科学的角度来看,我一直觉得 MATLAB/SIMULINK 不是一个好的解决方案。您使用什么语言来创建模型和模拟,为什么?

0 投票
2 回答
1406 浏览

user-interface - 我可以在 MATLAB GUI 中嵌入 Simulink 接口吗?

我想在 MATLAB GUI 窗口中显示 Simulink 工作区。这是装饰性的,因为我很清楚 Simulink 在没有这个添加的情况下运行良好。

但是,我不知道如何在 GUI 中创建一个可以显示 Simulink 工作区的空间。实际上,GUI 会在 Simulink 工作区周围形成一个厚框。请让我知道如何使用哪些命令来创建工作区窗口。

此外,在这个 GUI 中是否可以有一个存储块的地方,类似于 Simulink 库。

0 投票
2 回答
22036 浏览

user-interface - 如何将 Simulink 模块中的数据导入 MATLAB GUI?

我有一个 Simulink 模型,该模型将嵌入式 MATLAB 函数用于块,但我无法弄清楚如何在嵌入式 MATLAB 块和 GUI 之间实时移动数据(即在模型运行时)。我试图在我的模型中实现一个“到工作区”块,但我不知道如何正确使用它。

有谁知道如何将数据从 Simulink 模块实时移动到 GUI 中?

0 投票
2 回答
1928 浏览

matlab - 你能解释一下这个嵌入式 MATLAB 函数错误吗?

我在将值从 GUI 发送到 Simulink 模型中的嵌入式 MATLAB 函数 (EMF) 时遇到问题。我从 GUI 中的滑块获取此值并将其发送到模型中的 EMF 块。我可以确认该值已从我的 GUI 正确传输到我的 Simulink 模块,因为我可以在模型中使用显示模块显示该值,并在我更改 GUI 中的滑块位置时看到值的变化。但是,当我运行我的模型时,我不断收到此错误:

这是我的 EMF 块代码的一部分:

0 投票
1 回答
701 浏览

matlab - 来自 Wave 设备的 MATLAB set_param

如何在 simulink 模型中设置 from wave 设备模块的参数?

我需要设置“每帧样本”参数。它必须类似于 ('Model Name/ From Wave Device','Samples Per Frame',1024) ...但它不能像这样工作。

是否可以设置此块的参数?

0 投票
1 回答
847 浏览

matlab - Matlab Real-Time Workshop 中的 Makefile 错误

我正在使用 Real-Time Workshop 为 VxWorks 自动生成可执行文件,但在以下命令中出现错误:

这是生成文件:http: //pastebin.com/m5bdf2c4c