MATLAB: How to create a random 10×10 matrix with values between -10 and 10 matrices Z=rand(10,10) give me a random 10×10 matrix but between 0 and 1. How would I change this to be between -10 and 10? Best Answer a = -10;b = 10;Z = (b-a).*rand(10) + a;command window:>> ZZ = Columns 1 through 7 -7.8888 -7.3805 -5.7111 -8.3337 2.7580 4.6775 4.6755 1.8766 6.6746 0.3986 0.2221 -9.6776 -3.3602 -1.2566 -4.3454 6.0094 9.7837 -2.6633 7.9191 6.7950 -2.4032 -6.8956 8.3576 -0.2017 4.7896 0.3075 -2.5655 9.5931 -9.9868 -7.2539 3.8975 0.4948 0.8904 6.5643 -2.0201 -4.3281 0.0946 -1.7716 6.0904 2.1288 -6.4696 -1.1963 1.0162 -1.9008 -9.3045 6.3382 5.2087 -7.4096 -6.8638 7.4180 -6.5286 -4.1434 -6.2106 7.1069 7.5977 -3.4793 -9.1549 1.5037 6.0288 -7.5261 -2.3426 -9.1184 -3.7188 8.0944 2.1244 -3.0700 6.4199 -8.3070 3.7344 7.8900 Columns 8 through 10 -5.0595 4.0009 -4.8808 -3.7864 -5.7098 8.5834 -1.8226 3.5981 -0.6649 4.1602 1.1459 -4.9198 -7.1272 7.0136 -1.3756 7.4264 1.1713 4.0506 -8.3369 8.0355 -1.9534 -0.7652 -1.6096 -6.3632 -9.3922 -2.8374 7.1250 5.0640 -0.2202 1.6840 Related SolutionsMATLAB: How to calculate the area which located between curve and x-axis Try this:X = [1427.18976 1427.21024 1427.23072 1427.2512 1427.27168 1427.29216 1427.31264 1427.33312 1427.3536 1427.37408 1427.39456 1427.41504 1427.43552 1427.456];Y = [2098.083 2231.598 1888.275 1945.497 3280.65 6656.64 7667.55 7286.07 7514.94 7324.23 7095.33 6980.91 7534.02 7400.52];Z = trapz(X, Y) MATLAB: 10%+10% Because the % symbol indicates that the rest of the line is a comment. So the only non comment parameter Matlab sees is the first 10. Related QuestionInterX issues. Showing intersection when there is none.How to convert 2X4X10 array into 4x2x10 array
Best Answer