Argument to dynamic structure reference must evaluate to a valid field name.

V_c =2.*pi.*x10.((R-x9).^2 - x1.^2) + pi.*L.*(R.^2 - (R-x9).^2) +
pi.*x12.*((Ro+x6).^2 - (x1+x7).^2);
I am getting error in this that argument to dynamic structure reference must evaluate to a valid field name.

4 Kommentare

@Danishtah Quamar: please show us the complete error message. This means all of the red text.
Argument to dynamic structure reference must evaluate to a valid field name.
Error in objective_function (line 76)
V_c =2.*pi.*x10.((R-x9).^2 - x1.^2) + pi.*L.*(R.^2 - (R-x9).^2) + pi.*x12.*((Ro+x6).^2 - (x1+x7).^2);
Error in createAnonymousFcn>@(x)fcn(x,FcnArgs{:}) (line 11)
fcn_handle = @(x) fcn(x,FcnArgs{:});
Error in gacon (line 23)
Iterate.f = FitnessFcn(Iterate.x');
Error in ga (line 405)
[x,fval,exitFlag,output,population,scores] = gacon(FitnessFcn,nvars, ...
Error in GA_mains (line 6)
[x,fval]=ga(objFcn,nvars,[],[],[],[],lb,ub,consFcn);
Yes that was only problem in coding.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Typographical error.
The single . is generating the error.
V_c =2.*pi.*x10.((R-x9).^2 - x1.^2) + pi.*L.*(R.^2 - (R-x9).^2) + pi.*x12.*((Ro+x6).^2 - (x1+x7).^2);
↑ ← MISSING OPERATOR
See if:
V_c =2.*pi.*x10.*((R-x9).^2 - x1.^2) + pi.*L.*(R.^2 - (R-x9).^2) + pi.*x12.*((Ro+x6).^2 - (x1+x7).^2);
works. (I do not see any other problems.)
.

Weitere Antworten (0)

Kategorien

Mehr zu Robust Control Toolbox finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by