Ich habe meinen Code in aufsteigender Reihenfolge angeordnet. Ich muss eine normale Verteilung der Daten vornehmen. Ich muss random8 und random 24 haben. Ich bezweifle Array von kleinen mittleren und großen können normale Verteilung tun und auch die mittlere und Standardabweichung zu finden. Deshalb, wie kann ich für zufällige 8 tun und random24 Hier sind meine Codes:Wie Standabweichung und Mittelwert berechnen
symbols = {'SMALL', 'MEDIUM', 'LARGE'};
range = 101; % <-- Or 101 if you want from 0 to 100 with 100 included
rndInd = randi(numel(symbols), range ,1);
st = symbols(rndInd);
strjoin(st);
random24 = strtrim(cellstr(num2str(randi(24, range, 1))));
random8 = strtrim(cellstr(num2str(randi(8, range, 1))));
b = num2cell(sort(randi(24, range, 1)));
B = cellfun(@num2str, b, 'UniformOutput', false);
%B = sort(random24)
st = [ st' B random8 ]
%% MEAN
mean8=mean(random8);
fprintf('Mean of Random 8 parking Duration is %f',mean8);
mean24=mean(random24);
fprintf('Mean of Random 24 Hours is %f',mean24);
%% Standard deviation
standDev8= std(random8);
fprintf('Standard Deviation of Random 1-8 Hours of parking Duration is %f',standDev8);
figure(1);
histogram(random8);
title('Histogram of Data for Random 1-8 Hours of parking Duration')
standDev24= std(random24);
fprintf('Standard Deviation of Random 24 Hours is %f',standDev24);
figure(2);
histogram(random24);
title('Histogram of Data for Random 24Hours ')
Fehlermeldung i Undefinierte Funktion ‚Summe‘ für Eingabeargumente vom Typ ‚Zelle‘ zu bekommen.
Error in mean (line 116)
y = sum(x, dim, flag)/size(x,dim);
Error in RANDOM (line 15)
mean8= mean(B);