Hi Grace,
I understand that you have four symbolic variables h11, h12, h21, h22. You expressed the respective expression for each of these variables using other symbolic variables. You want to substitute new value for one of the symbolic variable which is a part of the expression and evaluate expression of variables h11, h12, h21, and h22 for this new value. I would like to suggest you to use struct datatype as follows to ease tasks which you want to achieve.
syms Av Riopamp Riminus Rf Ro omega Ciminus
T = struct;
T.h11=Riopamp+((Riminus*Rf)/(Riminus+Rf))
T.h12=Riminus/((Riminus+Rf))
T.h21=-(((Av*Riopamp)/Ro)+(Riminus/Rf))
T.h22=(Ro+Riminus+Rf)/((Ro*(Riminus+Rf)))
h11new=subs(T,Riminus,Riminus-(1/(1i*omega*Ciminus)))
for iterVar1 = 1 :2
for iterVar2 = 1: 2
simplify(h11new.("h"+iterVar1+iterVar2))
end
end
The individual fields of the structure, which are variables in your case, can be accessed by dot notation as follows:
>> T.h11