Cascading a User Definable number S Parameter objects together
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to cascade a number of S Parameter objects together. This number is user defineable. I am using the RF Toolbox command "sparameters" to read an .s2p file. The program asks for the number of files that the user wishs to input, then asks for their file names, and stores all the S Parameter objects in the same matrix "SPara".
The program then plots the individual file response. Followed by cascading the two S Parameter objects through the "cascadesparams" command, then plotting the cascaded response. I am able to cascade the files when only processing 2 files because I simply reference the two objects in the SPara matrix with in the "cascadesparams" command. However, the size of the SPara matrix is dependent on the number of files the user wishes to input. How do cascade based on the number of files the user inputs? The end result I would like to make a fuction that I can call any time. Here is my code:
%function S = importSpara()
n = input('Input number of files to be imported & cascaded:\n');
for x = 1:n
SPara(1,x) = sparameters(input('Input file name:\n'));
end
for i = 1:n
figure
rfplot(SPara(1,i))
end
SParaCasc = cascadesparams(SPara(1,1), SPara(1,2));
figure (3)
rfplot(SParaCasc)
%end
0 Kommentare
Antworten (1)
Jeff Miller
am 27 Jan. 2020
Maybe this?
n = input('Input number of files to be imported & cascaded:\n');
SPara= cell(1,n);
for x = 1:n
SPara{x} = sparameters(input('Input file name:\n'));
end
for i = 1:n
figure
rfplot(SPara{i})
end
SParaCasc = cascadesparams(SPara{:});
figure (3)
rfplot(SParaCasc)
3 Kommentare
Jeff Miller
am 27 Jan. 2020
OK, sorry for the distraction. I thought that syntax would convey all of the SPara's to cascadesparams, but apparently that isn't enough. It might be worth looking at whether SParaCasc actually does represent the cascade of all n SPara's with this syntax.
Siehe auch
Kategorien
Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!