n=100;
m=30;
n1=1;%limite inferiore
n2=100;%limite superiore
mat=zeros(n,m);
for k=1:n
mat(k,:)=randsample(n1:n2,m);
end
se non hai la funzione
randsample :
n=100;
m=30;
n1=1;%limite inferiore
n2=100;%limite superiore
mat=zeros(n,m);
for k=1:n
s=1;
while length(unique(s))~=m
s=randi([n1 n2],1,m);
end
mat(k,:)=s;
end