plotting graph using symbolic equation

1 回表示 (過去 30 日間)
grace lim
grace lim 2022 年 3 月 19 日
回答済み: Star Strider 2022 年 3 月 19 日
syms h11 h12 h21 h22 ZL
f=1000 to 1MHz
Zin=h11-(h12*h21)/(h22+(1/ZL)) %equation to plot
simplify(Zin)
pretty(Zin)
Avh=-h21/(Zin*(h22+(1/ZL)))
simplify(Avh)
fplot(f,Avh, 'b-', 'LineWidth', 2)
xlabel('Frequency', 'FontSize', 20);
ylabel('Gain Av', 'FontSize', 20);
title('Gain vs Frequency', 'FontSize', 20);
i need help to plot Av vs frequency symbolically
range of frequency 1KHz to 1MHz,
this is the equation to solve
Zin=h11-(h12*h21)/(h22+(1/ZL)) %equation to plot
simplify(Zin)
pretty(Zin)
Avh=-h21/(Zin*(h22+(1/ZL)))
simplify(Avh)

回答 (2 件)

Torsten
Torsten 2022 年 3 月 19 日
From what you wrote, there is no relation between f and Avh.
Can you write down Avh as a function of f so that - given numerical values for f - you directly get numerical values for Avh ?

Star Strider
Star Strider 2022 年 3 月 19 日
None of the variables are explicit functions of frequency. They must be functions of frequency and have all the other values defined numerically for this to work.
syms h11 h12 h21 h22 ZL
f=[1000 1E+6];
Zin=h11-(h12*h21)/(h22+(1/ZL)) %equation to plot
Zin = 
simplify(Zin)
ans = 
pretty(Zin)
h12 h21 h11 - -------- 1 h22 + -- ZL
Avh=-h21/(Zin*(h22+(1/ZL)))
Avh = 
simplify(Avh,500)
ans = 
figure
fplot(Avh,f, 'b-', 'LineWidth', 2) % The Frequency Range Vector 'f' Must Be The Second Argument In 'fplot'
Error using fplot>singleFplot
Input must be a function or functions of a single variable.

Error in fplot>@(f)singleFplot(cax,{f},limits,extraOpts,args) (line 200)
hObj = cellfun(@(f) singleFplot(cax,{f},limits,extraOpts,args),fn{1},'UniformOutput',false);

Error in fplot>vectorizeFplot (line 200)
hObj = cellfun(@(f) singleFplot(cax,{f},limits,extraOpts,args),fn{1},'UniformOutput',false);

Error in fplot (line 166)
hObj = vectorizeFplot(cax,fn,limits,extraOpts,args);
xlabel('Frequency', 'FontSize', 20);
ylabel('Gain Av', 'FontSize', 20);
title('Gain vs Frequency', 'FontSize', 20);
% i need help to plot Av vs frequency symbolically
% range of frequency 1KHz to 1MHz,
% this is the equation to solve
Zin=h11-(h12*h21)/(h22+(1/ZL)) %equation to plot
simplify(Zin)
pretty(Zin)
Avh=-h21/(Zin*(h22+(1/ZL)))
simplify(Avh)
.

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by