
ayuda ejercicio
Publicado por mana (3 intervenciones) el 22/10/2017 13:47:21
hola a todos,
tengo que hacer unos ejercicios con mat lab y no consigo hacer este, alguien me puede echar una mano:
if-statement: Write a short program using the if statement and the rand command,
that generates a uniform random number and stores it in r, then if r<0.5, set n=0,
otherwise set n=1. Finally, it displays the values of r and n (so that you can check if it is
working properly). Save the script as "Stepscript.m" in your working directory and launch
yo escribo
>> if r<0.5
n=0
elseif r>0.5
n=1
y me da error
diciendo q n es undefined near line 1 column 4
cualquier ayuda sera bien recibida
tengo que hacer unos ejercicios con mat lab y no consigo hacer este, alguien me puede echar una mano:
if-statement: Write a short program using the if statement and the rand command,
that generates a uniform random number and stores it in r, then if r<0.5, set n=0,
otherwise set n=1. Finally, it displays the values of r and n (so that you can check if it is
working properly). Save the script as "Stepscript.m" in your working directory and launch
yo escribo
>> if r<0.5
n=0
elseif r>0.5
n=1
y me da error
diciendo q n es undefined near line 1 column 4
cualquier ayuda sera bien recibida
Valora esta pregunta


0