0% found this document useful (0 votes)
38 views2 pages

Built in Functions Demo Student

Matlab Demo Function

Uploaded by

aliasger
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Built in Functions Demo Student

Matlab Demo Function

Uploaded by

aliasger
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Built-In Functions - Instructor Demo Page 1 of 2

For this part of the demo, the following commands are typed into MATLAB’s Command Window

Command Explanation
a = 5
a2 = [0:15:180]
a3 = [0:1:10]
a4 = [a3; 5*a3]
a5 = [0:0.5:5; 0:1:10]
q = randi(10)
s = randi(100,5)
u = randi([-5 60],[8 5])
k = zeros(5)
K = ones(2,8)
V = 5*ones(1,3)

Command Explanation

b = sin(a*pi)

b2 = sind(a2)
d = sqrt(a)
d2 = sqrt(a3)

f = nthroot(a3,3)

F = power(a3,3)
AA = exp(a)
BB = log(a)
CC = log10(a)

Command Explanation
g = length(a2)
G = length(a)
[r c] = size(a5)
h = size(a4)

Thinking Like an Engineer 3e Stephan, Bowman, Park, Sill, Ohland


An Active Learning Approach Copyright © 2015 Pearson Prentice-Hall, Inc
Built-In Functions - Instructor Demo Page 2 of 2

Command Explanation
n = [23 56 34 73 12 68]
N = sort(n)
Nd = sort(n,'descend')
p = [56 75 18; 23 45 8]
P = sort (p)
Pd = sort (p,2)
KK = sum(n)
K1 = sum(p)
K2 = sum(sum(p))
K3 = sum(p,2)
K4 = mean(n)
K5 = median(n)
M = max(n)
[A, B] = min(n)

M = max(p)
M = max(p,[],2)
M = max(max(p))
[A, B] = min(min(p))

Command Explanation
j = [1 3 1 5 7 7 7 5 5];
UNIQ = unique(j)

Command Explanation
[X, Y] = find(u == enter
an applicable number
here)

[x, y] = find(u > enter


an applicable number
here)

Warning: Do not use random functions or code segments found in the internet.
If you can't explain what a function does in detail,
you will not be allowed to use it and will receive a zero on the assignment.

Thinking Like an Engineer 3e Stephan, Bowman, Park, Sill, Ohland


An Active Learning Approach Copyright © 2015 Pearson Prentice-Hall, Inc

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy