# Wind turbine model block, cp(lambda, beta) function syntax error

30 visualizzazioni (ultimi 30 giorni)
Giovanni Ponce il 1 Nov 2022
Commentato: Ragul E il 12 Apr 2023
Hello, I am trying to run a wind turbine model block from simscape, and I am getting this error.
The expression: c1*(c2/u[2]-c3*u[3]-c4)*exp(-c5/u[2])+c6*u[1]
in 'Wind turbine model/cp(lambda,beta)/Fcn1'
has a syntax error
This formula is the generic equation to model cp(lmbda,beta), what am I doing wrong? Do I need to define the coefficients or is it a simple syntax error? I have attached pictures of the wind tubine block parameter
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
Ragul E il 12 Apr 2023
Hi brother i'm having the same issue could you help me in solving this

Accedi per commentare.

### Risposte (2)

Geetla Sindhu il 11 Nov 2022
Hello Giovanni,
I understand that you are getting syntax error using MATLAB function block in Simulink.
The cause of this error is the use of square brackets [ ] for indexing the input vector. Instead, you can try using the following syntax to solve the issue.
function y = fcn(u)
y = c1*(c2/u(2) c3*u(3) c4)*exp(-c5/u(2)) + c6*u(1);
end
Thank you.
##### 4 CommentiMostra 2 commenti meno recentiNascondi 2 commenti meno recenti
Rajagurunathan P il 27 Mar 2023
help me what i do any solution pls
Rajagurunathan P il 27 Mar 2023
help me pls mam ....

Accedi per commentare.

Sam Chak il 27 Mar 2023
The error clearly tells you that the math expression has a syntax error, which is a common error when programmer uses some characters incorrectly, or misses some punctuation marks.
In your case, you should use the hyphen-minus (-) an ASCII character, as if it is directly entered from the keyboard.
In short, use (-) instead of (–).
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Wind Power in Help Center e File Exchange

R2022a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by