CS 1371 Reference Sheet – Spring 2025

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/33

flashcard set

Earn XP

Description and Tags

A collection of vocabulary flashcards based on key functions and definitions used in CS 1371.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

34 Terms

1
New cards

round(num, N)

Rounds num to N decimal places.

2
New cards

floor(num)

Rounds num down to the closest integer.

3
New cards

ceil(num)

Rounds num up to the closest integer.

4
New cards

mod(x, a)

Returns the remainder after x is divided by a.

5
New cards

cos(th) and sin(th)

Returns the cosine or sine of the angle th in radians.

6
New cards

cosd(th) and sind(th)

Returns the cosine or sine of the angle th in degrees.

7
New cards

sum(arr, dim)

Returns the sum of values in arr across dimension dim.

8
New cards

prod(arr, dim)

Returns the product of values in arr across dimension dim.

9
New cards

mean(arr, dim)

Returns the average of values in arr across dimension dim.

10
New cards

median(arr, dim)

Returns the median of values in arr across dimension dim.

11
New cards

abs(num)

Returns the absolute value of num.

12
New cards

diff(vec)

Returns difference between consecutive elements in vec.

13
New cards

[a, i] = max(vec)

Returns the value a and index i of the maximum value in vec.

14
New cards

[s, i] = sort(vec, order)

Sorts vec by order, returning sorted vector s and indices i.

15
New cards

length(vec)

Returns longest dimension of vec.

16
New cards

size(arr)

Returns the number of rows, columns, and layers in arr.

17
New cards

zeros(r, c) and ones(r, c)

Creates double array of zeros or ones of dimensions (r, c).

18
New cards

true(r, c) and false(r, c)

Creates logical array of trues or falses of dimensions (r, c).

19
New cards

lower(str)

Lowercases all alphabetic characters in str.

20
New cards

upper(str)

Uppercases all alphabetic characters in str.

21
New cards

class(var)

Returns the data type of var as a string.

22
New cards

isempty(arr)

Returns true if any dimension of arr is 0.

23
New cards

ischar(x)

Returns true if input x is of string data type.

24
New cards

islogical(x)

Returns true if input x is of logical data type.

25
New cards

iscell(x)

Returns true if input x is of cell array type.

26
New cards

isstruct(x)

Returns true if input x is of structure type.

27
New cards

isnumeric(x)

Returns true if input x is of numeric data type.

28
New cards

cell(r, c)

Creates a cell array of empty cells with dimensions r by c.

29
New cards

fopen(fn, permission)

Opens a file with a specified permission.

30
New cards

fprintf(fh, line)

Prints a line to the text file specified by fh.

31
New cards

plot(x1, y1, style1, …)

Creates plot of x and y data according to specified style.

32
New cards

legend(label1, …, labeln, 'Location', loc)

Creates a legend for the plot in the specified location.

33
New cards

linspace(start, stop, N)

Creates a vector of N linearly-spaced numbers from start to stop.

34
New cards

rgb2gray(img)

Converts img to a single-layer grayscale image.