How about using global variables?
the function:
function dC = star(t,C)
dC = zeros(1,1);
Gn=1;
N=2;
f=3;
global w;
dC = (1/2)*Gn*N*C(1)+f*cos(w*t-C(1))
the script:
global w;
t =linspace(0,5,100);
C0 = [0];
for w = 0:6
[t,C] = ode45('star', t, C0);
%save t and C...
try sending the variables in model "a" to the base workspace, and keep monitoring those variables in "b" model... to keep the workspace clear, u can make them global.