Error using phase (line 15) Not enough input arguments.

>> f=10:1:100000; % f is the frequency varying from 10 to 100000 in steps of 1hz
G=2483.71.*(2.*pi.*f.*10).*((2.*pi.*f*100).*(10^18))/(((60.7.*2.*pi.*f.*100).*(10^-9))+1).*(((6.07.*2.*pi*f.*10).*(10^-9))+1);
faxis=0.000001*f;
plot(faxis,f,'w',f,G,'r')
xlabel('Frequency, rad/s'), ylabel('Gain, V/V')
title('Frequency Response Plots')
subplot(2,1,2);
>> semilogx(w, phase);
Error using phase (line 15)
Not enough input arguments.
Hey everyone, how are you? I am having some trouble with this code. I am trying to make the argument that 'w' is my variable and for it to be displayed in the graph, but it is not showing up in the window when I graph it. Instead I get this error, has anyone else had trouble with this?!
Please help me :(
Thank you!

13 件のコメント

Star Strider
Star Strider 2014 年 6 月 18 日
Including your phase function will help immeasurably!
That seems to be where the error is.
There are only 8 lines to the code you posted, so we have no idea what (line 15) refers to.
Sha Ka
Sha Ka 2014 年 6 月 18 日
Sorry for the late reply, let me try it out and I will let you know if it worked or not!
Sha Ka
Sha Ka 2014 年 6 月 18 日
編集済み: Star Strider 2014 年 6 月 18 日
I got this far with the coding:
>> f=10:1:100000; % f is the frequency varying from 10 to 100000 in steps of 1hz
G=2483.71.*(2.*pi.*f.*10).*((2.*pi.*f*100).*(10^18))/(((60.7.*2.*pi.*f.*100).*(10^-9))+1).*(((6.07.*2.*pi*f.*10).*(10^-9))+1);
faxis=0.000001*f;
plot(faxis,f,'w',f,G,'r')
xlabel('Frequency, rad/s'), ylabel('Gain, V/V')
title('Frequency Response Plots')
subplot(2,1,2);
semilogx(w, phase);
xlabel('Frequency, rad/s'), ylabel('Phase, deg')
xlabel ('Frequency in Hz')
ylabel ('Voltage in volts')
text (6,6,'G(f)')
Undefined function or variable 'w'.
How would I come about to setting w as a function? Do I just say w = (function)?
José-Luis
José-Luis 2014 年 6 月 18 日
Sha Ka
Sha Ka 2014 年 6 月 18 日
Edited!
José-Luis
José-Luis 2014 年 6 月 18 日
Where do you expect to get w from?
Star Strider
Star Strider 2014 年 6 月 18 日
@Sha Ka — PLEASE put your code in a separate script file and run it from there. I feel we’re chasing a moving target otherwise.
(P.S — I think I did all the editing.)
Sha Ka
Sha Ka 2014 年 6 月 18 日
Alright here is the script file :)
Star Strider
Star Strider 2014 年 6 月 18 日
w = ?
phase = ?
Sha Ka
Sha Ka 2014 年 6 月 18 日
Alrighty, I got it now, code works perfectly, I gave set the variables for them and now it's working ;D thank yOU!
Star Strider
Star Strider 2014 年 6 月 18 日
My pleasure!
Sha Ka
Sha Ka 2014 年 6 月 18 日
Btw Star Strider, I didn't get a chance to give you credit to your answer, if you would like just leave an answer below so I can rate that you helped me :)
Star Strider
Star Strider 2014 年 6 月 19 日
Thank you! I genuinely appreciate your concern and your support for my efforts!
I put my latest comment as an Answer (since it seemed to be the one of most relevance).

サインインしてコメントする。

 採用された回答

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2014 年 6 月 18 日

コメント済み:

2014 年 6 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by