how can i write a code with consecutive number between 0-100 and use this values inside my code?
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
isilay aydin
el 21 de Jul. de 2020
Comentada: Stephen23
el 22 de Jul. de 2020
x = 0.05 + (0.1-0.05).*rand(10,1);
i made this code to use number x with different values but i dont want them to be random numbers. how can i write a code with consecutive number between 0-100 and use this values inside my code?
0 comentarios
Respuesta aceptada
waqas
el 21 de Jul. de 2020
Is this what you are looking for?
x = 0.05 + (0.1-0.05).*[0:1:100]';
If you also want to control from which number (from 0:100) the array should start, then may be this line of code would help.
y = 10; %change it to the starting number that you want
x = 0.05 + (0.1-0.05).*[y:1:100]';
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!