As Image Analyst pointed out in his response earlier, FORMAT YOUR CODE PROPERLY! It is much more error-prone when things aren't indented and harder to debug. While MATLAB doesn't care, your (and our) time is valuable...
is the code I provided; NB the difference in the argument to the random number generators.
What you've written gives
Name Size Bytes Class Attributes
which you can't put into a single variable element and is not the total weight of the pallet to which you're comparing it.
You could do it this way if you do want to keep the statistics for the individual boxes as well as the pallet, but you've still got to then compute the overall sum of the weights to get the pallet weight.
Again, it would be far easier to keep stuff straight if you would use meaningful variable names that reflect what is actually in the variable instead of being generic to a fault. I like shorter variable names, too, but one can take things too far to that extreme as well.