Syntax Error in Simulink

  • Follow


I'm not that well versed in Matlab/Simulink and I'm having a problem using the function block in Simulink.

I have to plot a step-response function and keep getting a syntax error. This is a complex function so I'm not sure if I'm using the wrong block or just missed something in my equation. The equation I'm trying to plot is:

u(2)-(0.5-0.08*j)*exp(-(0.5+3.1225*j)*u(1))-(0.5+0.08*j)*exp(-(0.5+3.1225*j)*u(1))

Where u(1) is equal to 't' (time) using the Clock block, u(2) is the Step function, j is complex.

Any help will be appreciated.
0
Reply Eryk 3/22/2011 10:49:05 PM

I'd argue that if you're using the Fcn Block at all then you're using the wrong block -- it has only a limited set of functionality that can typically be better implemented using combinations of other blocks.

In your case the equation seems fine, so I assume that the Fcn block just doesn't allow for the complex j to be used inside it.

Try implementing the equation using a couple of complex constants, a gain block, a summation/subtraction block and a Math Fcn block (set to exp).

Phil.
0
Reply Phil 3/24/2011 3:07:05 AM


1 Replies
518 Views

(page loaded in 0.038 seconds)

Similiar Articles:













7/25/2012 8:11:17 PM


Reply: