Given a set of n vectors a_i, I am trying to find a vector x to minimize the expression |a_1-x|^p+|a_2-x|^p+|a_3-x|^p+…+|a_n-x|^p, where p is greater than 1.
I am having trouble with writing this sum expression in cvx syntax. Could someone explain what is wrong with the code below? In the code I try to initialize 5 15x1 vectors in sample, and try to find the correct value of x.
sample = rand(15,5);
minimize( sum(pow_p(abs(sample-x),p)) )