MATLAB: Problem plotting random vector hy, I have to make a hist(x,vet) where vet is a random vector of 1000 elements and vet is a vector of 10 elements. but the compuer tells me warning: hist: bin values not sorted on input how can i resolve? thanks Best Answer hist(x,sort(vet)) Related SolutionsMATLAB: Problem plotting with octave You are trying to plot a vector of length 100, x, against a vector of length 10, vet.By the way, have you considered using histc() ? MATLAB: For Loop in Data x = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0 ];y = cell(1, 4);for k = 1:4 y{k} = x(1-k:end) - x(1:end-k);endPrefer a cell array instead of hiding indices in the names of variables. Related QuestionSolving a system of anonymous functions using fsolveSimple For cycle (a small problem with the indexes)
Best Answer