As per my understanding, you want the variable “Value” to be of size (500*30) instead of (5*30). Since dimensions of the variable “Value” depends on the variable “Datax”, you should change the way you are indexing in “Datax”. Replace line number 3 of the code snippet you provided in the question with following:
Datax(100*(r-1)+w,:)=(W'*NewDatax(r,:)')';
This will modify the dimensions of the variable “Value” to (500*30).