Thanks so much, but in the sample code by you provided:

weight_grid=0:0.01:1;

n_grid_points=length(weight_grid);

var_y=NaN(n_grid_points,1);

var_pi=NaN(n_grid_points,1);

for grid_iter=1:n_grid_points

M_.osr.variable_weights(pi_pos,pi_pos) = weight_grid(grid_iter);

M_.osr.variable_weights(y_pos,y_pos) = (1-weight_grid(grid_iter));

oo_.osr = osr(var_list_,M_.osr.param_names,M_.osr.variable_indices,M_.osr.variable_weights);

if oo_.osr.error_indicator==0

var_y(grid_iter)=oo_.var(y_pos_var_list_,y_pos_var_list_);

var_pi(grid_iter)=oo_.var(pi_pos_var_list_,pi_pos_var_list_);

end

end

I want to ask this line:

oo_.osr = osr(var_list_,M_.osr.param_names,M_.osr.variable_indices,M_.osr.variable_weights);

what dose it means? What I confused is in reference I saw that M_.osr.param_names, M_.osr.variable_indices, M_.osr.variable_weights are output by an execution of the command osr, so it cannot write in options which specified in command osr. Please help me, thanks a lot.