MATLAB: How to reverse data normalized with bsx function

reverse of normalization;predictions

I used the code below to normalise the targets to perform RVM regression.
mn1 = mean(yTest);
sd1 = std(yTest);
sd1(sd1==0) = 1;
ynV = bsxfun(@minus,yTest,mn1);
ynV = bsxfun(@rdivide,ynV,sd1);
Can you please help to extract the predicted targets ..Thank you..

Best Answer

your_original_data = bsxfun(@times,ynV,sd1);
your_original_data = bsxfun(@plus,your_original_data,mn1);
What is the purpose of sd1(sd1==0) = 1 ? If that is really what you meant then, you also need to store the indexes of the affected values:
mn1 = mean(yTest);
sd1 = std(yTest);
idx = find(sd1 == 0);
sd1(sd1==0) = 1;
ynV = bsxfun(@minus,yTest,mn1);
ynV = bsxfun(@rdivide,ynV,sd1);
your_original_data = bsxfun(@times,ynV,sd1);
your_original_data(idx) = 0;
your_original_data = bsxfun(@plus,your_original_data,mn1);