New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

ENGR 121, Lab notes, Week 1

by: spencer.kociba

ENGR 121, Lab notes, Week 1 ENGR 121-B

Marketplace > Drexel University > Engineering and Tech > ENGR 121-B > ENGR 121 Lab notes Week 1

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Summary of lab: MATLAB Tutorial, basic vocabulary and hands on work with the program *This set of notes is very much like a beginner's glossary or can be used as a reference to basic commands in M...
Computation Lab I
Class Notes
Engineering, Matlab, programming, Tutorial, Vocabulary, reference
25 ?




Popular in Computation Lab I

Popular in Engineering and Tech

This 3 page Class Notes was uploaded by spencer.kociba on Wednesday September 21, 2016. The Class Notes belongs to ENGR 121-B at Drexel University taught by in Fall 2016. Since its upload, it has received 42 views. For similar materials see Computation Lab I in Engineering and Tech at Drexel University.

Similar to ENGR 121-B at Drexel

Popular in Engineering and Tech


Reviews for ENGR 121, Lab notes, Week 1


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/21/16
ENGR 121 B  Lab Notes for 9/21/2016 Spencer Kociba Summary of lab: MATLAB Tutorial, basic vocabulary and hands on work with the program *This set of notes is very much like a beginner's glossary or can be used as a reference to  basic commands in MATLAB ***Note: Important phrases, commands and concepts are in bold ● Uppercase vs lowercase matters ● Default variable is “ans” and will change if you do not assign a fixed variable  to your outcome ● multiplication= * ● division= / ● Variable = assignment   <<this is the format for assigning variables ● Clear (variable name) = remove variable from workspace ● MATRICES ○ >>C=[1,2,3,4,5]  <<commas can also be spaces  ○ >>size(C) ○ ans= 1     5 ○ Size = shows row by columns size of the matrix named ● Use a semicolon to suppress output in the command window (keeps space  uncluttered) ○ Ex. >>mynum=6; ○ >>mynum+34; ○ >>y=mynum/2 ○ >> ans = ○ >> y=20 ● who= shows all names of all variables in your workspace ● clc= clear all of command window (variables remain in workspace) ● Clear all  = deletes all variable assignments ● New Script Button: pulls up editor that you can edit, delete, run and save  written codes/programs (great for testing programs to get a certain answer aka the  quizzes coming up in later weeks) ○ Ex. 1­ x=10; ○ 2­ y=5; ○ 3­ z=x+y ○ “RUN” ○ ans=  ○ z=15 ● % in front of a command (in editor)= suspends actions in the program (if  running multiple times ○ Ex. 1­ %clear all ○ 2­ clc ○ 3­ x= x+4; ○ 4­ y=5; ○ 5­ z=x+y ■ z= (this value would increase every time you run the program) ■ If you remove the % in front and the (x+4) the  program will run as normal ● ( *number) ^ (power) *? ○ Is:  (value) (number)❑ ∗(value∗π) ○ Is NOT:  (number)❑ ● theta=_______ : assigned angle ○ Default is radians ● (trig func)d (____) = trig func results in degrees ● help(command name): detailed explanation of how the command works,  different uses for command, and differrent notations of the command in MATLAB ● exp(value):  e❑ (value) ○ ­5^2 = ­25 ○ (­5)^2= 25 ● fix()= rounds towards zero of nearest  ○ Negatives #s round up  ○ Positives #s round down ● round(X,N) = round to the Nth digit to the right of the decimal ● ceil(X) = round to the nearest integer towards infinity ● floor(X) = round to nearest integer towards negative infinity ● std= standard deviation (usually combined with randn(__)) ● = is used as the assignment operator ● == is used in a logical operation like “is the left equal to the right side in this  equation (will result in logical output of 0 or 1) ● PLOTTING ○ Creating plots/graphs in MATLAB requires a few steps ■ >>x= (number you want the x axis to start on): (increment):(number to end with); ■ >>Figure; ■ >>plot(variable or expression/equation); ■ >>y=(number you want at the top of the figure): (increment):(number you want at the bottom of the figure) ○ A graph will appear on your screen, with the x and y axis  labeled by the increments and in the range that you indicated  ● RANDOM NUMBERS ○ rand(a)= a x a matrix of random numbers in the range (0,1) ■ (all possible numbers between but not including  0 and 1) ■ ○ rand(a,b)= a x b matrix of random numbers in the range (0,1) ■ Addition or subtraction operations will change  the starting number of the range ● Ex. 5 + rand(a) has a range of  (5,6) ■ Multiplication or division will change the width of the range ● Ex. 5*rand(a) has a range of  (0,5) ○ randi(a,b)= b x b matrix of integers in the range (0, a) ■ (all possible integers between AND including 0  and a) ■ ○ randi([a,b],c,d)= range of (a,b) and matrix of c x d ○ randn() =bell curve of random deviations ■ Ex. 1+ 2*randn(100,1) ■ Mean= 1, StD= 2, Data generated in a 100 x 1  matrix ● LOGICAL TESTING ○ Outputs ■ 1=true ■ 0=false ○ > = is ≥ ○ < = is ≤ ○ ~ = is ≠ ○ && is “u and v” ○ || is “u or v” ■ Need to use && or || when doing several  inequalities in a row like or MATLAB will use order of operations ● Ex. >> 10>5>2 ● >>(logical:1)>2 ● >>logical: 0 ● Instead input: >> 10>5&&5>2


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Allison Fischer University of Alabama

"I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I LOVE StudySoup!"

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.