Question: 1. Write a matlab script that asks the user for a word. It the word is not the same as a predetermined password, it should

1. Write a matlab script that asks the user for a word. It the word is not the same as a predetermined password, it should ask again, and keep asking until the user enters the correct password. (Use a while loop to achieve this.) 2. Change your program from exercise 1 so that it also prints out the number of tries used to guess the word. 3. Write a matlab function that uses the low-level formatted read commands (fgetl, fscanf) to read the numerical values from a file (with the format shown below), sum the values, and output the sum to the command window. Be sure to appropriately open and close the file. You can use any text editor (e.g. notepad, textedit, the matlab editor) to create the file. Assume the file look like this: heights 3.24.23.115.36.3 4. Rewrite the following code using a vectorized operation in a single calculation within an assignment statement. Demonstrate the equivalency by coding and running both in matlab. 5. Demonstrate the use of logical indexing to find the subvector of all scores less than 60 from a vector of scores [65, 36, 81, 68, 18, 3, 16, 59, 29, 25, 22, 95, 62,98,30,34,8,77,32,74] 6. The following is a recursive definition of an where a is any integer and n is a non-negative integer: an=1an=aan1ifn=0ifn>0 Write a recursive function that receives values of a and n as inputs and returns an by using this recursive definition. You cannot use the operator anywhere in your program - use recursion inste
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
