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

Computing for Engineers

by: Mr. Durward Gleason

Computing for Engineers ENGR 1731

Mr. Durward Gleason
GPA 3.82

Maria Alba-Flores

Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

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

Maria Alba-Flores
Class Notes
25 ?




Popular in Course

Popular in General Engineering

This 3 page Class Notes was uploaded by Mr. Durward Gleason on Monday October 12, 2015. The Class Notes belongs to ENGR 1731 at Georgia Southern University taught by Maria Alba-Flores in Fall. Since its upload, it has received 20 views. For similar materials see /class/222069/engr-1731-georgia-southern-university in General Engineering at Georgia Southern University.

Popular in General Engineering


Reviews for Computing for Engineers


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: 10/12/15
E NGR 731 Computing for Engineers Mechanical and Electrical Engineering Technology Lecture 9 Decision making switch case otherwise structure Prof AlbaeFlores 2182009 Decision Making Decisions In most engineering applications we need to make decisions in order to solve the problem Most decisions are based on the value of some parameter When we write the MATLAB program used to find the result the decisions will be used to control the execution the program Decision Implementation In order to implement the decision statement in MATLAB we have three different structures a The SWItch Case structure b If structure c If elseif structure CASE Statement also known as switch or select statement The purpose of a CASE statement is to allow the value of a variable or expression to control the flow of progmm execution I The first line contains the actualword quot switchquot followed by eitherthe name ofa variable or some other expression I This Va riable or expression is referred to as the quotcontrol Va riablequot of the case statement I Afterthis first line thefollowing lines define one or more blocks of code that represent possible bmnchesthat program execution maytake Each block beginswith a line containing the case keyword followed by a Valuethatthe control variable may have lfthe value ofthe control variable matches this value program execution will execute the corresponding block of code If notthe value specified in the next block if presentl is examined and the process repeats 2182009 Genera rurm ume switch case othezwi 59 structure swuch expresson ass value 1 smremenrsI case value 2 srarememz case value 3 Statements 3 omerwrse Statemenksn The foHoww39ng examp e shows how to use the case Statementfm Mat ab F1nput39Enter a oneeuagae number x 39 svnutch x alsrla 39Yuu typed zeru39 case 9 d15play3915 a perfect square39 aae 2 d15play3915 an even number39 case 3 ease 5 case 7 uaapxaywa a prlne number 9352 4 uaapxaywa a perfect Square 9352 a dlsplavl li an even number othervnse dlsplavl Onlv slngleedlg numbers are alluvied Lab 5 Description Write a program in MATLAB that asksthe user to provide the following Calculate the respective function ofthe umberxaccording to the list given below Displaythe result and function performed us for the Cllculator Letter Function 5 mem c c smem T tangenttx R squareroot mverse 11m Q re L naturaHog mm o common og ogmm A Mallab code that can be use to solve the problem in Lab 5 i 2182009 ec x i nczlun ca calculac i aaani e a a toc eoaan i e r oc tangenc i acne e nece neane accmo ena iprlncii The angle F v5 has a as v5 n rxruxtryi Notes about gt strings gt formatting variables gt the fprlnt function Strings A slrmgis a setaftharatters ieuers that form an array or string The stnng is attuaiiy a vector whose components are the numenc tadesfarthe ietters cones are ascm e i gth S rsthe h en o number aftharactersA ouotatron wrthrnthe stnng is rnor s cateo by two ouote Syntax leccece 39Any characters39 Strings cont n wocdl w d ward3 s cancacenacee cnacaecec accaye ace 1 wordz traces ntu a new cnacaccec accay eencence 39Ynu 39are39 39rlghtl39 name 39Tnomae39 39R 39 39Lee39 5 e 39Hellu39 39Yes39 39No39 39Guudbye39 fprintf Write formatted function The tpcancu function wiii piste output onthe screen wrth the specrneo format Requires a conversion characterfor each variabiethatwiii be sent to the screen am2mm Character on Singietharatter m Detimai natatransr Exvnnentiai natatmn iusrng a iowercase e as in aaasemui u Expnnentiai natatmn iusrng an uppercase c as in 3 1415mm a rrxeocporntnotatron as stnng or characters Prinu culux sc nan 9s 96d 1 fpr intf Examples iv ite an maaaec c sc n xed stringfarmat re ietters natnumbers means oecrmai number no format is specmeo ans Minimum of 1 rnteger sf fixcpmnlfarmal The 1 me the 5 me ns 5 orgrts tothe nght afthe oecrmai paint means new ime


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

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!"

Amaris Trozzo George Washington University

"I made $350 in just two days after posting my first study guide."

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."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

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.