signal generation model in Simulink from matlab

不想你离开。 提交于 2019-12-13 09:17:45

问题


How do I generate following signal in simulink:

t=(0:1000)/1000*10*pi; 

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;

回答1:


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. 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.

EDIT following comments

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

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.



来源:https://stackoverflow.com/questions/20940517/signal-generation-model-in-simulink-from-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!