100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
MATLAB: A Practical Introduction to Programming and Problem Solving Second Edition SOLUTION MANUAL $24.99   Add to cart

Exam (elaborations)

MATLAB: A Practical Introduction to Programming and Problem Solving Second Edition SOLUTION MANUAL

 3 views  0 purchase
  • Course
  • MATLAB: A Practical Introduction to Programming a
  • Institution
  • MATLAB: A Practical Introduction To Programming A

MATLAB: A Practical Introduction to Programming and Problem Solving Second Edition SOLUTION MANUAL

Preview 4 out of 293  pages

  • September 3, 2024
  • 293
  • 2024/2025
  • Exam (elaborations)
  • Only questions
book image

Book Title:

Author(s):

  • Edition:
  • ISBN:
  • Edition:
  • MATLAB: A Practical Introduction to Programming a
  • MATLAB: A Practical Introduction to Programming a
avatar-seller
Americannursingaassociation
MATLAB: A Practical Introduction to
Programming and Problem Solving

Second Edition

SOLUTION MANUAL




Stormy Attaway

College of Engineering
Boston University

,I. Introduction to Programming Using MATLAB

Chapter 1: Introduction to MATLAB

Exercises

1) Create a variable to store the atomic weight of silicon (28.085).

>> siliconAtWt = 28.085
siliconAtWt =
28.0850

2) Create a variable myage and store your age in it. Subtract one from the value of
the variable. Add two to the value of the variable.

>> myage = 35;
>> myage = myage - 1;
>> myage = myage + 2;

3) Use the built-in function namelengthmax to find out the maximum number of
characters that you can have in an identifier name under your version of MATLAB.

>> namelengthmax
ans =
63

4) Explore the format command in more detail. Use help format to find options.
Experiment with format bank to display dollar values.

>> format +
>> 12.34
ans =
+
>> -123
ans =
-
>> format bank
>> 33.4
ans =
33.40
>> 52.435
ans =

, 52.44

5) Find a format option that would result in the following output format:
>> 5/16 + 2/7
ans =
67/112

>> format rat
>> 5/16 + 2/7
ans =
67/112

6) Think about what the results would be for the following expressions, and then
type them in to verify your answers.
* 4
3 + 4 ^ 2
4 \ 12 + 4
3 ^ 2
(5 – 2) * 3

>> * 4
ans =
25

>> 3 + 4 ^ 2
ans =
19

>> 4 \ 12 + 4
ans =
7

>> 3 ^ 2
ans =
9

>> (5 - 2) * 3
ans =
9

7) The combined resistance RT of three resistors R1, R2, and R3 in parallel is given
by
1
RT = 1 1 1
 
R1 R2 R3

, Create variables for the three resistors and store values in each, and then
calculate the combined resistance.

>> r1 = 3;
>> r2 = 2.2;
>> r3 = 1.5;
>> rt = 1/(1/r1 + 1/r2 + 1/r3)
rt =
0.6875

As the world becomes more “flat”, it is increasingly important for engineers and
scientists to be able to work with colleagues in other parts of the world. Correct
conversion of data from one system of units to another (for example, from the
metric system to the American system or vice versa) is critically important.

8) Create a variable pounds to store a weight in pounds. Convert this to kilograms
and assign the result to a variable kilos. The conversion factor is 1 kilogram = 2.2
pounds.

>> pounds = 30;
>> kilos = pounds / 2.2
kilos =
13.6364

9) Create a variable ftemp to store a temperature in degrees Fahrenheit (F). Convert
this to degrees Celsius (C) and store the result in a variable ctemp. The conversion
factor is C = (F – 32) * 5/9.

>> ftemp = 75;
>> ctemp = (ftemp - 32) * 5/9
ctemp =
23.8889

10) Find another quantity to convert from one system of units to another.

>> kmPerMile = 1.6093;
>> miles = 6;
>> km = miles * kmPerMile
km =
9.6558

11) The function sin calculates and returns the sine of an angle in radians. Use help
elfun to find the name of the function that returns the sine of an angle in degrees.
Verify that calling this function and passing 90 degrees to it results in 1.

>> sind(90)

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Americannursingaassociation. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $24.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

73314 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$24.99
  • (0)
  Add to cart