Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

I am trying to run this code but getting the mentioned error: I tried to indent the code with smart ident but it is not working either! solution suggested for this kind of error.

1 visualización (últimos 30 días)
clc
clear all
syms q C TOT
S=6 ;
D=4800 ;
%D=7200;
A=25 ;
%Delta=0.2 ;
P=10000;
F=50 ;
B=7;
V=1 ;
d=50 ;
%q=156;
%C=47;
tow=0.1 ;
M=7250 ;
%M=5800;
%M=4350;
n=2 ;
%n=3;
%n=1;
%n=6;
%M=800;
%G1=0.208 ;
%G1=0.2075;
G1=0.21;
%G1=0.394;
%G1=0.675;
c0=800 ;
q=0;
% C=46.8064;
for i=1:10
C=((2*n*q)/((2*D)+(q*G1)))*(tow*M )
q=sqrt(((2*D)*(A+C+(n*F)))/(n*((B+(d*G1))+(S+(d*G1))*((((2-n)*D)/P)+n-1)+(V*G1 ))))
TOT=(tow*M*(log(c0/C)))+((D/(n*q))+(G1/(2*n)))*(A+C+(n*F)+(V*n*q))+[(q/2)*((B+(d*G1))+(S+(d*G1))*((((2-n)*D)/P)+n-1))]
%TOT= ((D/(n*q))+(G1/(2*n)))*(A+C+(n*F)+(V*n*q))+[(q/2)*((B+(d*G1))+(S+(d*G1))*((((2-n)*D)/P)+n-1))]
End

Respuestas (1)

Shubhankar Poundrik
Shubhankar Poundrik el 10 de Jun. de 2020
Editada: Shubhankar Poundrik el 10 de Jun. de 2020
Hi Shunmugam,
I understand that you are getting the following error while trying to run your code:
Error: File: untitledx.m Line: 33 Column: 1
At least one END is missing: the statement may begin here.
This is simply a case of incorrect syntax. The correct keyword to put after an if statement is end, not End.
The following code may work:
clc
clear all
syms q C TOT
S=6 ;
D=4800 ;
%D=7200;
A=25 ;
%Delta=0.2 ;
P=10000;
F=50 ;
B=7;
V=1 ;
d=50 ;
%q=156;
%C=47;
tow=0.1 ;
M=7250 ;
%M=5800;
%M=4350;
n=2 ;
%n=3;
%n=1;
%n=6;
%M=800;
%G1=0.208 ;
%G1=0.2075;
G1=0.21;
%G1=0.394;
%G1=0.675;
c0=800 ;
q=0;
% C=46.8064;
for i=1:10
C=((2*n*q)/((2*D)+(q*G1)))*(tow*M )
q=sqrt(((2*D)*(A+C+(n*F)))/(n*((B+(d*G1))+(S+(d*G1))*((((2-n)*D)/P)+n-1)+(V*G1 ))))
TOT=(tow*M*(log(c0/C)))+((D/(n*q))+(G1/(2*n)))*(A+C+(n*F)+(V*n*q))+[(q/2)*((B+(d*G1))+(S+(d*G1))*((((2-n)*D)/P)+n-1))]
%TOT= ((D/(n*q))+(G1/(2*n)))*(A+C+(n*F)+(V*n*q))+[(q/2)*((B+(d*G1))+(S+(d*G1))*((((2-n)*D)/P)+n-1))]
end
Regards,
Shubhankar

Community Treasure Hunt

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

Start Hunting!

Translated by