I apologize for the incredibly basic question I'm assuming it has something to do with Matlab versions but this old code that is very simple I cannot seem to make it work.
for n = 1:4
a{n} = randint(n,n,[0,9]);
b{n} = randint(n,n,[0,9]);
fprintf(’n =
end
I changed randint to randi per recommendation of matlab.
EDIT:
I was able to make it work by manipulating the code to this.
for n=1:4
a{n}= randi(9,n)
b{n}= randi(9,n)
fprintf('n = %d:\n', n), A = a{n}, B = b{n},
end
now generates two 4x4 matrices with random numbers between [0,9].
Can somebody explain to me why though? The first formatting looks better than the second one logically.
0 Comments
Sign in to comment.