Parse/Syntax Error

15 vues (au cours des 30 derniers jours)
Angel Guzman
Angel Guzman le 31 Mar 2020
Commenté : Les Beckham le 31 Mar 2020
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)));
^

Réponses (1)

James Tursa
James Tursa le 31 Mar 2020
lamda**2 is Fortran. I presume you want lamda^2 instead
  5 commentaires
James Tursa
James Tursa le 31 Mar 2020
@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
Les Beckham le 31 Mar 2020
Good point.

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by