本文介绍了Matlab中Simulink中的信号生成模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在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:

  1. 将模型的停止时间设置为1000s,并使用步长为1s的固定步长求解器.
  2. 使用抽取值为1的时钟块.那就是你的0:1000向量.
  3. 将Clock块的输出输入到增益块,增益设置为1/(10000*pi).那就是你的t向量.
  4. 将您的t信号输入到两个三角函数块,一组设置为sin,另一组设置为cos.这将生成两个信号sin(t)cos(t).
  5. 现在使用t信号与sin(t)信号相乘. > Product 块,以生成您的x信号(t*sin(t)).
  6. tcos(t)执行相同的操作以生成您的y信号. z已经完成,因为它等于t.
  1. Set the stop time of your model to 1000s and use a fixed-step solver with a step time of 1s.
  2. Use a Clock block with a decimation of 1. That's your 0:1000 vector.
  3. Feed the output of your Clock block to a Gain block, with the gain set to 1/(10000*pi). That's your t vector.
  4. Feed your t signal to two Trigonometric Function blocks, one set to sin and one set to cos. That will generate two signals, sin(t) and cos(t).
  5. Now multiply your t signal with your sin(t) signal using a Product block, to generate your x signal (t*sin(t)).
  6. Do the same thing with t and cos(t) to generate your y signal. z is already done since it's equal to t.

编辑以下评论

您的评论的答案实际上是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 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中的信号生成模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 04:12