Thank again for your replay, it was very helpful.
I have one more question if you don't mind.
How is it possible to add a constraints on the weights using your reformulation.
for example limiting the max weight to 5% I tried this:
Sharpe = [0 <= z, z'*(r) == 1, z./sum(z)<0.05];
optimize(Sharpe, z'*R*z);
wS = value(z)/sum(value(z));
returnSharpe = wS'*r;
varianceSharpe = sqrt(wS'*R*wS);
but it don't seems to like it and the results are strage.
Thanks,
Tal