basic error, help me

7 次查看(过去 30 天)
whiyan
whiyan 2020-10-20
评论: whiyan 2020-10-20
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

采纳的回答

Stephan
Stephan 2020-10-20
编辑:Stephan 2020-10-20
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)

更多回答(2 个)

KSSV
KSSV 2020-10-20
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)

Torsten K
Torsten K 2020-10-20
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:

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by