Did you check the help for the function (e.g. load2disp <http://www.pserc.cornell.edu/matpower/docs/ref/matpower6.0/load2disp.html> in the online function reference)?
idx is simply a vector of bus indexes, in your case it should be simply be equal to 2 (a 1 x 1 vector). Ray > On Jul 17, 2017, at 2:29 AM, Akash Tyagi <akashtyagi0...@gmail.com> wrote: > > Hello everyone, > I am using load2disp command and I understand everything in that command > except the input index. > Suppose I want to convert the fixed load to dispatchable load at bus 2 only. > I tried by using the following command- > clc > clear > close all; > define_constants; > mpc0=loadcase(case5a); > idx1=mpc0.bus([2,3],PD); > mpc1=load2disp(mpc0,'Akash',idx1); > It is not working? > Thanks in advance