MATLAB: How to repeat c parameter(box constraint) using different value

boxconstraintsvmstructsvmtrain

example below, i need to repeat 1 with others number
SVMStruct = svmtrain(data(train,:),Y(train),'Kernel_Function','linear','BoxConstraint',1,'showplot',true);

Best Answer

if islogical(train)
numtrain = sum(train);
else
numtrain = length(train);
end
bc = rand(1, numtrain); %data of the appropriate size
SVMStruct = svmtrain( data(train,:), Y(train), 'Kernel_Function', 'linear', 'BoxConstraint', bc, 'showplot', true);