What is the difference between the MATLAB command window and a script file? For
ID: 3781493 • Letter: W
Question
What is the difference between the MATLAB command window and a script file? For a matrix, B, that has dimensions (m, n): How many rows does it have? How many columns? How is the 1st element addressed? How is the last element addressed? an array, A, that has 8 elements: V hat is the MATLAB command to delete the last element in A? What is the MATLAB command to replace the 1^st element in A with a zero? In MATLAB, how do you indicate a comment? In MATLAB, what are the rules for naming variables? In MATLAB, what will happen if you type the following command? squareroot=5 In MATLAB, what is the difference between the clock command and the clear command? In MATLAB, the colon operator can be used in two ways: creating a matrix (or array) and selecting part(s) of a matrix (or array). Explain and give examples of each For a matrix C, that has 10 rows and 12 columns: What is the MATLAB command to select all of row 5 from it? What 2 MATLAB commands would ask the user for an integer, N, from 1 to 10 and then create an array D which is just row N from matrix C? For matrix D, that has 5 rows and 8 columns: What does the MATLAB command Z=sum(D) do and what is the size (or dimensions) of Z?Explanation / Answer
Since there are two many questions as per chegg policy iI will solve only 3.
1) Matlab command window immediately performs the operation to the workspace. Where as a script file can contain many lines of code and saved in the 123.m file extension. To run this file we go to the command window and type 123.m
2)
3)
----------------------
A = 1:10 ; % 1-D array
ind = A.length; % getting last element
A(ind) = [] ; % remove
-------------------------------
A = 1:10 ; % 1-D array
ind =[1]; % getting last element
A(ind) = [0] ; % put zero
4)
A comment is indicated by % at the beginning of the line
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.