5 matlab codes 18, Suppose I seed to fetch a mmumerical variable named hours from the user This vaniable needs to be son-orgative Ioe the emaining code in the projert to work property. so before S...
18, Suppose I seed to fetch a mmumerical variable named hours from the user This vaniable needs to be son-orgative Ioe the emaining code in the projert to work property. so before So, we will got the vue of hours fromm the user, and if it is segative, we will tell the user that it ut be non-aegative, and reprompt for a value We will hoep doing this until the uer gots it correct Give the code lor the enkire probdenm 19 Suppose we know that a certain array fib will hold N values event ually (after some computation) and that the value of N is already assigsed. Give the matlab code for "preallocating" storage for the array fib, as as N by I column vectoe, hiding the output from this commabd 20. Suppose we want to compute N terms in a Fibonacci sequence but using the first two terms in the sequence being set by the user The Fibonari sequence is defined as for ii 2 2 Assume that N has already been gotten from the user, and that it is greater than or equal to 2. Give the command for "preallocating" storage for the array fib as an N tby I column vector. Hide the output. Also assume that the frst two teems have been fetched from the user, and have berm assigsed to ib(1) and ib(2) What matlab programming structure should be used for this task
18, Suppose I seed to fetch a mmumerical variable named hours from the user This vaniable needs to be son-orgative Ioe the emaining code in the projert to work property. so before So, we will got the vue of hours fromm the user, and if it is segative, we will tell the user that it ut be non-aegative, and reprompt for a value We will hoep doing this until the uer gots it correct Give the code lor the enkire probdenm 19 Suppose we know that a certain array fib will hold N values event ually (after some computation) and that the value of N is already assigsed. Give the matlab code for "preallocating" storage for the array fib, as as N by I column vectoe, hiding the output from this commabd 20. Suppose we want to compute N terms in a Fibonacci sequence but using the first two terms in the sequence being set by the user The Fibonari sequence is defined as for ii 2 2 Assume that N has already been gotten from the user, and that it is greater than or equal to 2. Give the command for "preallocating" storage for the array fib as an N tby I column vector. Hide the output. Also assume that the frst two teems have been fetched from the user, and have berm assigsed to ib(1) and ib(2) What matlab programming structure should be used for this task