simulink

Matlab Simulink: Transfer Function

I am trying to model a transfer function block for let's say 1/(s+1). I am having a hard time coming up with proper search terms for it, hence having trouble finding out how I can achieve this on the Internet. What is the easiest way to implement a block for a transfer function in Simulink? Thanks in advance. ...

Simulink: type consistency errors

Using this Simulink model file as a reference, I'm trying to figure out the two following errors: I have no idea what has gone wrong with the data type consistency/conversion problems. Do you know what the error messages mean exactly in the context of a model? It would be great to get an interpretation of the problem to solve it. Tha...

Simulink: implementing a custom transfer function

Let's say I implement this m-file: Fq=tf(0.5^2,[1 2*0.7*0.5 0.5^2]); G=tf(0.006*[200 1],[80 1 0]); Q=Fq/G; open Inner_Loop.mdl Inside Inner_loop.mdl, if I want to implement/model a transfer function block using G, how can it be achieved easily? In other words, how can I retrieve the numerator and denominator of a tf easily? Thanks i...

Simulink: Specifying trajectory

I would like to use jtraj to specify a trajectory in a Simulink model. Below are what I attempted to retrieve in the command prompt: Q0 = [1 1 0]; Q1 = [1+0.5*cos(2*20) 1+0.5*sin(2*20) 0]; t = 0:0.1:20; [Q, Qd, Qdd] = jtraj(Q0, Q1, t); However, I don't know how to include such trajectory data in the Simulink model easily. Any comments...

Implementing custom Matlab functions in Simulink

Hi, I would like to use custom Matlab function in Simulink. So far I have done it by placing Embedded Matlab Fuction block. However if the custom function contains another custom function the compile process fails. Here is the example of function I am trying to embed in the simulation: function [c, d, iterationsCount] = decodeLDPC(y, ...

site for simulink projects?

hello could anyone give me a site in which i can find simulink projects? i want simulink project (not MATLAB codes) so where can i find this? mathworks site offer a lot of projects most of which are written with matlab code please help thank you ...

Could not determine the size of this expression.

Hi, I have resently started to use MATLAB Simulink, and my problem is that i can't implement an AMDF function, because simulink compiler cannot determine the lengths. Simulink errors: |--------------------------------------------------------------------------------------- Could not determine the size of this expression. Function 'Embe...

Why is simulink data type conversion block altering the data when it should be typecasting?

I am attempting to typecast some data from int32 to single. I first tried using the 'Data Type Conversion' block with single output data type and the Stored Integer option. However, I found that the datatype conversion block is not typecasting the data the way I expect it to. Am I using the block incorrectly, or is it failing to work ...

In simulink , I need to add a branch line through command.

How to connect a line from the already connected line in simulink model using matlab command .i.e, i need to connect the same signal to another block.(branch line or split line.) Can add_line even adds such branch line(from line to a block connection). if so please guide me.or any other alternatives? ...

When to use Simulink in an embedded processor.

We are developing a motor controller on a dsPIC. We intend to use Simulink to model the motor control algorithm with Real Time Embedded Workshop to convert the Simulink model into C code. Our firmware will have some other minor logic operations, but its main function is motor control. We are wondering if we should try to do all the f...

Execute file from matlab

Hi my friends. I have a simulink model in Matlab. how can I build excute file from that model? ...

How to get the content of an embedded MATLAB function

In my Simulink model are some embedded MATLAB functions. Is there a way to get the content (the text you see in the editor) of this blocks? My first guess was to use find_system to get the embedded MATLAB functions and then get_param to get the content. But I dont find the needed parameter name. The documentation didnt show up any param...

How do interface a LIDAR device with MATLAB?

I have a Hokuyo USB LADAR/LIDAR. I have problem with interfacing or connecting it to MATLAB/Simulink, such that I can do all the processing in those software packages. I have already asked Hokuyo. They only provide C++ program interface (sample programming guide and libraries). How do I interface this to MATLAB/Simulink? ...

Loading the data for a Simulink Lookup Table from a file

Hello, I've built a Matlab/Simulink model that I'm using to simulate the performance of an underwater robotic vehicle that uses acoustics for various key navigation and localisation functions. Since the characteristics of the ocean change with seasonality and geolocation, I would like this data to be dynamically loaded into the model f...

Making a from workspace simulink block tunable

Hi I have this problem. I've a simulink model that read data from workspace in real time execution. In such a way i'm able to produce a voltage output in order to obtain that a motor follows the desired trajectory that i compute in a m-file. Now the problem is: If i would like to change the trajectory while the simulation is running how...

Model in the loop testing of C code in Matlab/Simulink

I make a distributed embedded application that will make use of several micro-controllers. The unit under control is a mechanical unit that I do not have, but I have a Simulink model of it. What are the possibilities to perform Model-in-the-loop testing of existing C code with minimum modification of it? ...

How does Simulink simulation engine work ?

Hi ! I would like to understand how Simulink simulation engine works. Does it use a discrete event simulation mecanism (then how continous time is handled ?) ? Does it rely on a static cycle-based code generation ? Or ? Thx ! JC ...

Failed to find library 'powerlib' matlab. Simulink program executing

When I tried to run a Simulink program under my R2009a Matlab, it showed an error message as follows: Failed to find library 'powerlib' referenced by 'dcmotor_openloop/Armature Current '. This library must be on your MATLAB path. I'm wondering where I can find this powerlib. ...

Looking for solution in Simulink

Hello! I looking for block in Simulink to make some recursion, for example: I want calculate A_(k+1) = 2 * A_(k) , where k = 1,2,3,4 and A_(1) = 3. How to make something like this ? I only find initial values in integrator :/ ...