vec = randperm(n);
This solution seems to run correctly in MATLAB (desktop)... can anyone tell me why it is coming back with an "Assertion Failed"?
function vec = makeRandomOrdering(n)
vec = zeros(1, numel(n));
flags = zeros(1, numel(n));
index = 1;
while (sum(flags) ~= numel(n))
pos = randi(numel(n));
if (flags(pos) ~= 1)
vec(index) = n(pos);
index = index + 1;
flags(pos) = 1;
Times 2 - START HERE
Remove the small words from a list of words.
Given an unsigned integer x, find the largest y by rearranging the bits in x
Sum all integers from 1 to 2^n
Determine the number of odd integers in a vector
Get ranking of a combination
Project Euler: Problem 3, Largest prime factor
Poker Series 08: IsPair
Steal, Share, or Catch: Tournament of Champions
Steal, Share, or Catch
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office