-2

Can you kindly help me as to where am I going wrong? the error shows :Subscript indices must either be real positive integers or logicals. Here, selected_variables is a matrix of (4*2) and I intend to use

lambda=transpose(0:0.1:5);
 for i = 1:size(selected_variables,1)
  for j= 0:size(lambda,1)
      modelselcurve(j)=(cellfun(@rdivide, selected_variables(i,2),sigmahat))+(cellfun(@mtimes,num2cell(lambda(j,1)),selected_variables(i,3)))
  end
  figure
  plot(modelselcurve)

end

user2458552
  • 419
  • 2
  • 5
  • 17

1 Answers1

1

You are starting j with value 0. This is not possible in Matlab

karl71
  • 1,082
  • 2
  • 18
  • 29