问题描述
如何在simulink中生成以下信号:
How do I generate following signal in simulink:
t=(0:1000)/1000*10*pi;
我要构建以下matlab代码的模型:
I want to build the model of the following matlab code:
t=(0:1000)/1000*10*pi;
x = (t).*sin(t);
y = (t).*cos(t);
z = t;
推荐答案
这是相当基本的东西.您是否已阅读过Simulink的任何教程,介绍视频/网络研讨会甚至文档的入门指南?
This is fairly basic stuff. Have you gone through any Simulink tutorial, introduction videos/webinars or even the getting started guide of the documentation?
这里有一些建议可以帮助您回答问题:
Here are a few suggestions to help you answer your question:
- 将模型的停止时间设置为1000s,并使用步长为1s的固定步长求解器.
- 使用抽取值为1的时钟块.那就是你的
0:1000
向量. - 将Clock块的输出输入到增益块,增益设置为
1/(10000*pi)
.那就是你的t
向量. - 将您的
t
信号输入到两个三角函数块,一组设置为sin
,另一组设置为cos
.这将生成两个信号sin(t)
和cos(t)
. - 现在使用t信号与
sin(t)
信号相乘. > Product 块,以生成您的x
信号(t*sin(t)
). - 对
t
和cos(t)
执行相同的操作以生成您的y
信号.z
已经完成,因为它等于t
.
- Set the stop time of your model to 1000s and use a fixed-step solver with a step time of 1s.
- Use a Clock block with a decimation of 1. That's your
0:1000
vector. - Feed the output of your Clock block to a Gain block, with the gain set to
1/(10000*pi)
. That's yourt
vector. - Feed your
t
signal to two Trigonometric Function blocks, one set tosin
and one set tocos
. That will generate two signals,sin(t)
andcos(t)
. - Now multiply your
t
signal with yoursin(t)
signal using a Product block, to generate yourx
signal (t*sin(t)
). - Do the same thing with
t
andcos(t)
to generate youry
signal.z
is already done since it's equal tot
.
编辑以下评论
您的评论的答案实际上是Simulink的基本内容.在尝试在Simulink中进行VR等高级操作之前,您应该学习如何使用Simulink.有点像在跑步之前先跑步.
The answer to your comment is really basic Simulink stuff. You should learn how to use Simulink before trying to do advance stuff like VR in Simulink. It's a bit like trying to run before you can walk.
以下是一些有用的资源:
Here are a few resources that may be useful:
- Simulink视频和示例
- Simulink网络研讨会
- Simulink教程
- Simulink入门 Simulink文档
- Simulink Videos and Examples
- Simulink Webinars
- Simulink tutorial
- Getting Started with Simulink in the Simulink Documentation
我对VRML不太了解,但是请注意VRML中的坐标系与MATLAB/Simulink中的坐标系不同(请参见 http://www.mathworks.co.uk/help/sl3d/vrml.html ).您还应该查看 Simulink 3D Animation文档中的虚拟世界与模型的连接.
I don't know much about VRML, but be aware that the coordinate system in VRML is different from that in MATLAB/Simulink (see http://www.mathworks.co.uk/help/sl3d/vrml.html). You should also have a look at Virtual World Connection to a Model in the Simulink 3D Animation documentation.
这篇关于Matlab中Simulink中的信号生成模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!