basic error, help me

11 vues (au cours des 30 derniers jours)
whiyan
whiyan le 20 Oct 2020
Commenté : whiyan le 20 Oct 2020
x = linspace(20,100000);
y = 20*log10(1./(1+(2*(3.14)*(x)*(985.1)*(59*10.^-9)-(985.1/(2*(3.14)*(x)(4.7*10.^-3))).^2).^0.5);
plot(x,y)
If it write like this there is error like the below, whats the matter? Can you mend it??
Thans
error: parse error:
syntax error
>>> y = 20*log10(1./(1+(2*(3.14)*(x)*(985.1)*(59*10.^-9)-(985.1/(2*(3.14)*(x)(4.7*10.^-3))).^2).^0.5);
^
error: 'y' undefined near line 1, column 1

Réponse acceptée

Stephan
Stephan le 20 Oct 2020
Modifié(e) : Stephan le 20 Oct 2020
2 closing brackets missing, one '*' operator missing, one times use './' instead of '/':
x = linspace(20,100000);
y = 20*log10(1./(1+(2*(3.14)*(x)*(985.1)*(59*10.^-9)-(985.1./(2*(3.14)*(x)*(4.7*10.^-3))).^2).^0.5));
plot(x,y)

Plus de réponses (2)

KSSV
KSSV le 20 Oct 2020
x = linspace(20,100000);
y = 20*log10(1./(1+(2*3.14*x*985.1*(59*10.^-9)-(985.1./(2*3.14*x*(4.7*10.^-3))).^2).^0.5));
plot(x,y)
  1 commentaire
whiyan
whiyan le 20 Oct 2020
this is also correct. thanks a lot~~~

Connectez-vous pour commenter.


Torsten K
Torsten K le 20 Oct 2020
Is this what you are looking for?
clearvars;
x = linspace(20,100000);
y = 20*log10(1./(1+(2*3.14*x*985.1*(59*10.^-9)-(985.1./(2*3.14*x*4.7*10.^-3))).^2).^0.5);
plot(x,y)
If not, please enter the equation with the formula editor:
  1 commentaire
whiyan
whiyan le 20 Oct 2020
this efforts helped me and appeciate it~~~

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by