Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 3.1
- Question 1
- Help gives detailed information about the funtion written after it, with additional sourcss for information.
- helpwin lists topics for groups of functions.
- doc displays online documentation in the Help browser inside matlab.
- Question 2
- ver gives detailed version description with package names and directories
- version version gives version number only
- 3.2
- Question 1
- ans is used to display the answer of the most recent answer, and is variable created automatically when you specify no output argument
- Question 2
- semicolons are used to separate rows in an array creation command, or to suppress the output display of a line of code.
- Question 3
- yes, variables are case sensetive.
- Question 4
- These are functions, not variables.
- It's possible to overwrite them, and they will turn into variables.
- to undo it, you need to use the clear function.
- Question 5
- the semi colon in this function seperates rows in the array (matrix)
- Question 6
- A = [0:3.14/4:3.14]
- Question 7
- A=[1:3 ; 4:6 ; 7:9]
- Question 8
- rand(M,N) uniformly distributed random numbers and arrays in an m-by-n matrix of random entries
- randn(M,N) Normally distributes random numbers and arrays in an m-by-n matrix of random entries
- Question 9
- returns the sizes of each dimension of an array in a vector.
- Question 10
- displays value of variable
- Question 11
- because X is 4x2, Y is 3x4
- Question 12
- puts elements on the main diagonal only
- Question 13
- sums diagonal elements
- Question 14
- a = sum(diag(A));
- Question 15
- displays cell array contents
- Question 16
- indicates nonexecutable text within the body of a program
- Question 17
- Curly braces encase the answer in a cell
- Question 18
- gets names of fields
- Question 19
- determines whether input is a structured array
- Question 20
- rmfield
- 3.3
- Question 1
- The %{ and %} symbols enclose a block of comments that extend beyond one line
- % is a one line comment
- Question 2
- the gamma increased
- Question 3
- The picture gets brighter
- Question 4
- cellmode has functions that allow you to break your scripts into smaller chunks that can be run individually
- Question 5
- help is created by inserting comments at the beginning of your program. If your program includes a function, type the help text below the function definition line
- Question 6
- Elapsed time is 0.043596 seconds.
- Elapsed time is 0.0402439 seconds.
- 0.003 faster?
- Question 7
- .^ is element-wise power
- ^ is matrix power
- Question 8
- Elapsed time is 0.00017786 seconds.
- Much faster
- Question 9
- i=0;
- t=0;
- while t < 3.14*2
- t = t+3.14/4;
- i=i+1
- x(i) =sin(t)
- end
Advertisement
Add Comment
Please, Sign In to add comment