Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Programa para generar un vector de 10 números aleatorios
- % Salida, vector con 10 numeros aleatorios
- % Entrada, cantidad de numeros a mostrar
- clearvars
- clc
- cantidad = input('Ingrese la cantidad de elementos del vector: ');
- vec = zeros(1,10);
- for x=1:cantidad
- vec(x) = rand();
- disp(['Elemento ' num2str(x) ' del vector: ' num2str(vec(x))]);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement