Question
Matlab 1. Type the following in the command window & press enter 3 + 4.322 Question: What is the default variable name MATLAB gives for
Matlab
1. Type the following in the command window & press enter 3 + 4.322 Question: What is the default variable name MATLAB gives for the answer?
2. Type the following string in the command window & press enter. -234 + 34*3 Question: Did MATLAB create a new variable name or overwrite the previous one?
The default variable is a number. Change you change it to a character? How would you assign the variable the character 'K'?
3. Type the following in the command window. (Press enter after each line) Num1 = 4.56 Num2 = -43434 z = Num1 + Num2 whos z Question: The class refers to the how a number is represented. What is the variable represented as?
4. Type the following in the command window & press enter z = int8(z) Question: Why is z not the answer it was before?
5. Type the following in the command window and press enter v = [3,4,6] v2 = [3;4;6] Question: What is the difference between v and v2. How many rows and columns do v and v2 have?
6. Type the following in the command window and press enter v = [1:7:765] Question: What did the command do? How can you determine how many elements the vector have has? How many elements does the vector have? Question: What is the value of the 53 element? Question: How can a column vector be created using the colon operator?
7. Type the following in the command window & press enter m = [3,4,-3,8; 4,3,6,0; 1,3,4,7] Question: What was created? How many rows and columns are there? Question: Which command would index the value at the 2nd row, 3rd column? a. m(3,2) b. m(2,3) c. m(2,1) d. m(1,2) Question: What command would get all of the values in column 4? a. m(:,3) b. m(3,:) c. m(4,:) d. m(:,4)
8. Type the following in the command window. Press enter after every line X = [1:10] Y = [1:2:20] M = [Y; X] Question: What was created? Type the command M = M'. What happened?
9. Type the following in the command window & press enter Number = input('enter a number: ') Question: What happens once enter is pressed?
10. Type the following in the command window & press enter. display(m) Notice it displays the variable m, which was a matrix from earlier.
11. Type the following in the command window & press enter. fprintf('pie is .2f%, pi) Notice it is similar to C for displaying floats. pi is a MATLAB constant
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started