• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 17 pages
Exam (elaborations)

Engineering 101 MATLAB Exam With Complete Solutions Latest Update

Document preview thumbnail
Preview 3 out of 17 pages

Engineering 101 MATLAB Exam With Complete Solutions Latest Update...

Content preview

Engineering 101 MATLAB Exam With Complete
Solutions Latest Update


program - ANSWER a sequence of statements that instruct the computer to do
something.



interactive program - ANSWER Write statements in the terminal. Hitting Return executes
them immediately



script - ANSWER Write a series of statements ahead of time. Execute those statements
sometime later



suppress an output - ANSWER ;;



display - ANSWER produces an output



variables - ANSWER used to store data. refers to some chunk of memory where the
program stores a value. may contain letters of '_'. Case sensitive

ex: x, y, z



expressions - ANSWER used to compute new data

ex: x = 10+5, y = x .* 7.

consist of literals (3, 7.5), variables (a,b,c), and function calls (sin(3), sqrt(x))



assignment - ANSWER used to store a value into a variable

LHS = RHS, work right to left, takes the value of the RHS and stores it into the LHS.

ex: x .* 7 is assigned to y. variable may be re-assigned many times in code

,operators - ANSWER form compound expressions (+, *, -, etc)



whos - ANSWER used to get information about a variable, including the type of data it
currently stores



orange line around = - ANSWER warning, code will still run



comments - ANSWER use the % symbol. anything after the % until the end of the line is a
comment, comments are ignored by the program but are more for the human reader of
the code to help manage complexity



scalar - ANSWER single number or element



vector - 1 dimensional sequence of numbers or elements, numbers or elements can be
separated with spaces or commas



matrix - 2 dimensional grid of numbers or elements, you separate rows using ; or a new
line. you can use smaller matrices as components, if things doesn't line up, you get an
error



[] creates a vector or a matrix



(:) creates evenly spaced vectors. first:step:last

ex: 1:3:12 outputs [1,4,7,10], if the step is omitted it defaults to one



(') - ANSWER transpose operation takes a matrix and produces a copy with the rows
turned into columns



flipud - ANSWER flips the rows up/down

, fliplr - ANSWER flips columns left or right



array - ANSWER everything in matlab is an array. scalar = 1x1, vector = mx1 or 1xn,
matrix is mxn



zeros(m,n) - ANSWER returns an m x n matrix of zeros



zeros(m) - ANSWER returns a matrix of zeros using m for both rows and columns



ones(m,n) - ANSWER returns a m x n matrix of ones



ones(m) - ANSWER returns a matrix of ones using m for both rows and columns



magic(s) - ANSWER returns an s x s magic matrix. magic because each column sum =
each row sum = each diagonal sum.



repmat(A,xTimes,yTimes) - ANSWER makes a new matrix based on repeating matrix A a
certain number of times in the x direction and y direction



reshape(A,numRows,numCols) - ANSWER creates a new matrix with the same elements
as A, but the requested number of rows and columns. The dimensions must match up
with the original number of elements in A.



numel(x) - ANSWER gives the number of elements in x



length(x) - ANSWER gives the number of elements along the longest dimension of x



size(x) - ANSWER returns a vector with the number of elements along each dimension of

Document information

Uploaded on
November 11, 2024
Number of pages
17
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$15.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Easton
3.9
(124)
Sold
605
Followers
221
Items
28026
Last sold
2 days ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions