• 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 2 out of 9 pages
Exam (elaborations)

Matlab Exam With Complete Solutions Latest Update

Document preview thumbnail
Preview 2 out of 9 pages

MATLAB EXAM WITH COMPLETE SOLUTIONS LATEST UPDATE...

Content preview

MATLAB EXAM WITH COMPLETE SOLUTIONS
LATEST UPDATE


linspace - ANSWER Creates a linearly spaced vector:

example: (numbers from 2 to 4 in 3 digits equally spaced)

>>linspace(2,4,3)

234



logspace - ANSWER creates a logarithmically spaced vector

example:(numbers from 10^1 to 10^2 in 2 digits)

>>logspace(1,2,2)

10 100



rand(n) - ANSWER creates an nxn matrix of random reals



rand(n,m) - ANSWER creates an nxm matrix of random reals



randi([range],n,m) - ANSWER creates an nxm matrix of random integers in the range



zeros(n) - ANSWER returns an nxn matrix of all zeros



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



ones(n) - ANSWER returns an nxn matrix of all ones

, ones(n,m) - ANSWER returns an nxm matrix of all ones



length - ANSWER returns the number of elements in a vector or the larger dimension for
matrix



size - ANSWER returns the number of rows and columns:

to capture the values in separate variables

[r, c] = size(mat)

r= 3

c=2



numel - ANSWER returns total number of elements in a vector or matrix



reshape (mymat,n,m) - ANSWER changes dimensions



example:

25

78

53

>> reshape(mymat,1,6)

ans =

275583



rot90 - ANSWER rotates a matrix 90 degrees counterclockwise



fliplr - ANSWER flips columns of matrix left to right

Document information

Uploaded on
November 11, 2024
Number of pages
9
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$13.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