what does this u[1] represents in the following equation??
Show older comments
*cos(u[1]*2pi*f1)*in this u[1] means what???
similarly in this equation:[refer the below image]
(2/3)(u[1]+u[2]*cos(2*pi/3)+u[3]*cos(4*pi/3))*
u[2],u[3] means what?
please explain me.check the image for the equations.

Answers (3)
John D'Errico
on 25 Jan 2011
0 votes
u[1] represents a syntax error in matlab.
Or, rather, I should say that it IS a syntax error. If you wish to index a variable, as u(1) would do, you use parens, not square brackets.
Walter Roberson
on 25 Jan 2011
0 votes
You are reading code written in some other computer language. Depending in the computer language, u[T] might be the same as Matlab's u(T), or it might be the same as Matlab's u(T+1). As there is no u[0] referenced, it is most likely that u[1] is Matlab's u(1)
Matlab's symbolic toolbox uses the [] notation for subscripting.
Note by the way that 2pi is not valid Matlab syntax: you would need 2*pi in Matlab.
3 Comments
Walter Roberson
on 25 Jan 2011
I checked the diagram; the [] very likely represent subscripting and should be changed to () for use in Matlab.
balaji`
on 25 Jan 2011
Walter Roberson
on 25 Jan 2011
I do not see cos(2*pi*f*t) in the diagram?
If you are looking at some reference material for State Vector PVM then it would help to post a URL for it, so that we could read the equations in context.
Paulo Silva
on 25 Jan 2011
0 votes
u[1] means first value of the input vector u
I think simulink changed the way it represents u[1], open a Fcn block and see if it's u(1) or u[1], it's the same thing, new versions got u(1).
It means that u is a bunch of values, something similar to this 3 6 5 4 6 5 6... in this simple case u[1] is equal to 3 because 3 is the value of the first element of the vector.
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!