x=10*rand(1.100); Warning: Size vector should be a row vector with integer elements. x=10*rand(1.100);hist(x) Warning: Size vector should be a row vector with integer elements. x=10*rand(1.100);hist(x) Warning: Size vector should be a row vector with integer elements. x=10*rand(1,100);hist(x) y=exp(x);figure,hist(y) x=10*rand(1,100);hist(x) y=exp(x);figure,hist(y) z=log(50*x);figure,hist(z) mean(x),median(x) ans = 4.60963899858016 ans = 4.46291118942864 mean(y),median(y) ans = 1.575810833455201e+003 ans = 86.82605053982795 mean(z),median(z) ans = 5.09914639192727 ans = 5.40777429107596 x=100*rand(1,20);main(x),max(x) ??? Undefined function or variable 'main'. x=100*rand(1,20);mean(x),max(x) ans = 47.42007825066989 ans = 90.16098247652447 x=sort(x); 1/40:1/20:1; xp=(3*x(1)-x(2))/2 xs=(3*(20)-x(19))/2 ??? xp=(3*x(1)-x(2))/2 xs=(3*(20)-x(19))/2 | Error: Missing operator, comma, or semicolon. xp=(3*x(1)-x(2))/2,xs=(3*(20)-x(19))/2 xp = -1.62053357517359 xs = -14.51608618847139 xd=[xp,x,xs];yd=[0,y,1]; plot(x,y,'.') ??? Error using ==> plot Vectors must be the same lengths. plot(x,y,'.'); ??? Error using ==> plot Vectors must be the same lengths. plot(xd,yd) ??? Error using ==> plot Vectors must be the same lengths. xp=(3*x(1)-x(2))/2,xs=(3*x(20)-x(19))/2 xp = -1.62053357517359 xs = 90.72538752631532 plot(x,y,'.'); ??? Error using ==> plot Vectors must be the same lengths. xd=[xp,x,xs];yd=[0,y,1]; plot(x,y,'.') ??? Error using ==> plot Vectors must be the same lengths. y y = 1.0e+004 * Columns 1 through 3 0.00282054380983 0.00758733847665 0.00095782861904 Columns 4 through 6 0.03296622786813 0.20055028334393 0.01999827608655 Columns 7 through 9 0.06050221021836 0.00080905284020 0.00446200675772 Columns 10 through 12 0.25232082823377 0.09054730496866 0.01005797823273 Columns 13 through 15 0.02924480734625 0.28132804848124 0.00018072853896 Columns 16 through 18 0.04151711549066 0.00016531590570 0.00636722355186 Columns 19 through 21 0.00211150650691 0.62708783772242 0.00011619446068 Columns 22 through 24 0.21635461705486 1.64560651860221 1.99468382516308 Columns 25 through 27 0.26667530423153 0.00803655287784 0.01459279540473 Columns 28 through 30 0.00084963215921 0.06232345164497 0.00245412598026 Columns 31 through 33 1.47793468742285 0.14312703226297 0.00615304443057 Columns 34 through 36 0.17124113991264 0.00145774017914 0.00813892414743 Columns 37 through 39 1.13140555065387 0.09282705612694 0.00083779113685 Columns 40 through 42 0.44133194866941 0.05379932428049 0.00038103745246 Columns 43 through 45 0.00079353486909 0.04335423329841 0.05439615087743 Columns 46 through 48 0.00406406281874 0.03146553114947 0.00913089003600 Columns 49 through 51 0.00015510827780 0.00013123917422 0.00228020508346 Columns 52 through 54 0.00011372644196 0.00465102577455 0.09262643583161 Columns 55 through 57 0.00025305194994 0.00014238767250 0.04566671615000 Columns 58 through 60 0.04393971229454 0.00011706956903 0.00011776834554 Columns 61 through 63 0.00066908832497 0.03539602854503 0.00017785721843 Columns 64 through 66 0.00394755063934 0.05525321642002 0.13081173101532 Columns 67 through 69 0.10191191422849 0.00023181990380 0.00940241343345 Columns 70 through 72 0.00829537288876 0.00342095399134 0.00046462647872 Columns 73 through 75 0.08595822335975 0.10880400935352 0.14438830013572 Columns 76 through 78 0.01195630454891 0.02568314064035 0.00033550649532 Columns 79 through 81 0.00906983721920 0.12854054614096 0.75433079236432 Columns 82 through 84 0.00153486067164 0.00127775912823 0.57447103855612 Columns 85 through 87 0.00102113894111 0.31297782712135 0.88129317117252 Columns 88 through 90 0.00101649261418 0.00109476590136 0.00016446783624 Columns 91 through 93 0.00021898668605 0.06067726043423 0.00067454331395 Columns 94 through 96 0.46225186078294 0.00056916630686 0.00055175180879 Columns 97 through 99 2.08051307332502 0.00812806978433 0.00299784709356 Column 100 0.00231541285897 y=1/40:1/20:1; plot(x,y,'.') plot(xd,yd) ??? Error using ==> plot Vectors must be the same lengths. yd=[0,y,1] yd = Columns 1 through 3 0 0.02500000000000 0.07500000000000 Columns 4 through 6 0.12500000000000 0.17500000000000 0.22500000000000 Columns 7 through 9 0.27500000000000 0.32500000000000 0.37500000000000 Columns 10 through 12 0.42500000000000 0.47500000000000 0.52500000000000 Columns 13 through 15 0.57500000000000 0.62500000000000 0.67500000000000 Columns 16 through 18 0.72500000000000 0.77500000000000 0.82500000000000 Columns 19 through 21 0.87500000000000 0.92500000000000 0.97500000000000 Column 22 1.00000000000000 plot(xd,yd) interp1(a,b,7.4) ??? Undefined function or variable 'a'. interp1(yd,xd,0.5) ans = 45.40216309401104 median(x) ans = 45.40216309401104 interp1(yd,xd,0.56) ans = 45.97451960636887 interp1(yd,xd,1.56) ans = NaN interp1(yd,xd,1) ans = 90.72538752631532 interp1(yd,xd,0) ans = -1.62053357517359 xs xs = 90.72538752631532 xp xp = -1.62053357517359 interp1(yd,xd,0062) ans = NaN interp1(yd,xd,0.62) ans = 48.73019714557805 interp1(yd,xd,0.05) ans = 2.73732141468119 x=57*rand(1,13) x = Columns 1 through 3 37.05606536501085 56.03030357664633 31.50237487628663 Columns 4 through 6 22.80419040290988 11.33094562733665 35.63645830343736 Columns 7 through 9 41.80167970781177 21.42547245593880 0.56295838523079 Columns 10 through 12 23.93189495968248 42.95916867137447 45.25069115974216 Column 13 52.43756078166467 x=sort(x) x = Columns 1 through 3 0.56295838523079 11.33094562733665 21.42547245593880 Columns 4 through 6 22.80419040290988 23.93189495968248 31.50237487628663 Columns 7 through 9 35.63645830343736 37.05606536501085 41.80167970781177 Columns 10 through 12 42.95916867137447 45.25069115974216 52.43756078166467 Column 13 56.03030357664633 y=1/26:1/13:1 y = Columns 1 through 3 0.03846153846154 0.11538461538462 0.19230769230769 Columns 4 through 6 0.26923076923077 0.34615384615385 0.42307692307692 Columns 7 through 9 0.50000000000000 0.57692307692308 0.65384615384615 Columns 10 through 12 0.73076923076923 0.80769230769231 0.88461538461538 Column 13 0.96153846153846 mean(x) ans = 32.51767417485175 max(x) ans = 56.03030357664633 min(x) ans = 0.56295838523079 diary off