Parse/Syntax Error
이전 댓글 표시
I am writing a simple functin to solve for a frequency (OmegaD) and cannot figure out what the problem is, although it says it's an issue with syntax.
The name of the file: Parametros2doOrden.m
Here's the code:
Lamda = 0.3333
OmegaN= 3
OmegaD = OmegaN(sqrt(1-(lamda**2));
The error shown in the command window is the following:
>> Parametros2doOrden
parse error near line 3 of file /Users/guzmanleo17/Parametros2doOrden.m
syntax error
%tiempoP = pi/omegad;megad;mda**2)));
^
답변 (1개)
James Tursa
2020년 3월 31일
0 개 추천
lamda**2 is Fortran. I presume you want lamda^2 instead
댓글 수: 5
Angel Guzman
2020년 3월 31일
James Tursa
2020년 3월 31일
편집: James Tursa
2020년 3월 31일
I just noticed this also
OmegaN(...
should be
OmegaN*...
Les Beckham
2020년 3월 31일
You are also missing a parenthesis on this line (in addition to the multiplication that James pointed out).
OmegaD = OmegaN(sqrt(1-(lamda**2));
James Tursa
2020년 3월 31일
@Les: It's not that there is a missing ) at the end, it is that the first ( is erroneous and should be a * instead.
Les Beckham
2020년 3월 31일
Good point.
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!