vec = randperm(n);
Surely these ! echo "function assert(~) " >./assert.m solutions are not valid?
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;
Back to basics 7 - Equal NaNs
Rotate a Matrix by 90 degrees
Say something funny
01 - Scalar variables
Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
Implement Solitaire cipher for N long deck.
Project Euler: Problem 6, Natural numbers, squares and sums.
Find best domino orientation
Is this a valid Tic Tac Toe State?
Poker Series 10: bestHand
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