Provide the matlab syntax that will ask a user at the command window to enter a
ID: 3821163 • Letter: P
Question
Provide the matlab syntax that will ask a user at the command window to enter a name and assign the name to a variable called 'name'.
Provide the header line of a function, called getInfo, that is passed two input arguments when called, and returns three output arguments.
Write the matlab code lines that add 2 to the value of a variable called x only if its value is less than 10.
Write the first line of an indefinite loop that would instead add 2 to the value of a variable called x until it’s value exceeds 10.
In programming, mistakes in reasoning that lead to a program that runs but does not solve the problem correctly are called ___________________ errors.
List the types of information that should be provided in the initial comment block of a program
Explanation / Answer
There are multiple questions in one post.
1. name = input('Please enter your name');
2. function [a, b, c] = getInfo(p, q)
3. while(x < 10)
x = x + 2;
end
4. In programming, mistakes in reasoning that lead to a program that runs but does not solve the problem correctly are called logical errors.
5. It should include all the defining information about who wrote the code, and why, and when, and what the code does.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.