How to perform arithmetic operation on sparameters?

1 回表示 (過去 30 日間)
Aakriti Srivastava
Aakriti Srivastava 2022 年 7 月 19 日
回答済み: Sulaymon Eshkabilov 2022 年 7 月 19 日
I have calculate sparameters of RF circuit for range of frequency. Now I want to perform the operation and getting some error shown below.
hR1 = resistor(50,'R50');
hckt1 = circuit('example2');
add(hckt1,[1 2],hR1)
add(hckt1,[2 3],resistor(100))
setports (hckt1, [1 0],[3 0])
freq = linspace (1e3,2e3,100);
S = sparameters(hckt1,freq,100);
for cont = 1:freq %freq =5 to test
S(:,:,cont) = 5*(S(:,:,cont)) - 10
end
Error :
Operator '*' is not supported for operands of type 'sparameters'.
Would you please let me know how to perform the operation Please?

採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022 年 7 月 19 日
There is a small error in your script. Here is the corrected one:
hR1 = resistor(50,'R50');
hckt1 = circuit('example2');
add(hckt1,[1 2],hR1)
add(hckt1,[2 3],resistor(100))
setports (hckt1, [1 0],[3 0])
freq = linspace (1e3,2e3,100);
S = sparameters(hckt1,freq,100);
for cont = 1:numel(freq) % Iterate for the length of freq
S.Parameters(:,:,cont) = 5*S.Parameters(:,:,cont) - 10;
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRF Network Construction についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by