extract the data from s2p file in matlab

I want to extract the data from s2p file which contains s11,s21,s12,s22 data. I want to get the s21 data and store in some variable and then repeat the same procedure several s2p files in loop.
S1='TEM_TriFeed_EPattern_';
S2='.s2p';
for i=0:2:10;
S3=strcat(S1,num2str(i),S2);
assignin('base',['a',num2str(i)],sparameters(sprintf('%s',S3)));
strcat('a',num2str(i),'_s21')= rfparam(['a',num2str(i),'.s2p'],2,1);
end
while using the above code I am getting the error at 'rfparam' function, since rfparam needs sparameters object data, but I am giving the char type data. this error is occuring. Can someone give the solution to this. It will be great help to me.

Answers (0)

Products

Asked:

on 22 May 2015

Community Treasure Hunt

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

Start Hunting!