• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 258 páginas
Examen

MATLAB for Engineers, 5th Edition – Complete Solution Manual (Chapters 2–6) with Code Examples

Document preview thumbnail
Vista previa 4 fuera de 258 páginas

This comprehensive solution manual provides detailed, step-by-step MATLAB® code and explanations for homework problems from Chapters 2 through 6 of MATLAB for Engineers, 5th Edition. It includes solutions for foundational topics such as variable operations, array and matrix manipulation, plotting (2D, 3D, logarithmic, polar), function creation, symbolic math, numerical methods (interpolation, differentiation, integration), and data analysis. Each problem is accompanied by executable MATLAB scripts, tables, graphs, and annotations, making it an ideal resource for students, educators, and engineering professionals looking to verify solutions, learn MATLAB programming techniques, or prepare for exams.

Vista previa del contenido

Matlab for Engineers, 5th Edition
Chapter 2 Homework Solutions

clear,clc, format shortg



You can either solve these problems in the command window, using MATLAB® as an electronic
calculator, or you can create an M-file of the solutions. If you are solving these problems as a homework
assignment or if you want to keep a record of your work, the best strategy is to use an M-file, divided
into cells with the cell divider %%.

Problem 2.1
Predict the outcome of the following MATLAB® calculations. Check your results by entering the
calculations into the command window.

1 + 3/4


ans = 1.75

5*6*4/2


ans = 60

5/2*6*4


ans = 60

5^2*3


ans = 75

5^(2*3)


ans = 15625

1 + 3 + 5/5 + 3 + 1

ans = 9

(1 + 3 + 5)/(5 + 3 + 1)


ans = 1



Using Variables

Problem 2.2
Identify which name in each of the following pairs is a legitimate MATLAB® variable name. Test your
answers by using isvarname—for example,

1

,isvarname fred

Remember, isvarname returns a 1 if the name is valid and a 0 if it is not. Although it is possible
to reassign a function name as a variable name, doing so is not a good idea. Use which to check
whether the preceding names are function names—for example,

which sin

In what case would MATLAB®tell you that sin is a variable name, not a function name?

The legitimate Matlab names are: fred book_1 Second_Place No_1 vel_5 tan

isvarname fred


ans = 1

isvarname book_1


ans = 1

isvarname Second_Place


ans = 1

isvarname No_1


ans = 1

isvarname vel_5


ans = 1

isvarname tan %although tan is a function name it can be used as a variable name


ans = 1

isvarname fred! %! is not an allowed character


ans = 0

isvarname book-1 % - is not an allowed character


ans = 0

isvarname 2ndplace %variable names must start with a letter


ans = 0

isvarname #1 %# is not an allowed character


ans = 0

isvarname vel.5 % . is not an allowed character


ans = 0
2

, isvarname while %while is a reserved name


ans = 0


which tan % tan is a function name


built-in (C:\Program Files\MATLAB\R2016b\toolbox\matlab\elfun\@double\tan) % double method

which while %while is also a function name, but is reserved


built-in (C:\Program Files\MATLAB\R2016b\toolbox\matlab\lang\while)


%You can reassign a function name as a variable name
%For example
sin=3


sin = 3

%The which function now tells us sin is a variable
which sin


sin is a variable.

% Use the clear function to return sin to its function definition
clear sin
which sin

built-in (C:\Program Files\MATLAB\R2016b\toolbox\matlab\elfun\@double\sin) % double method



Scalar Operations and Order of Operations

Problem 2.3
Create MATLAB® code to perform the following calculations. Check your code by entering it into
MATLAB® and performing the calculations on your scientific calculator.

5^2


ans = 25

(5 + 3)/(5*6)


ans = 0.26667

sqrt(4+6^3) % or...


ans = 14.832

(4+6^3)^(1/2)


ans = 14.832
3

, 9*6/12 + 7*5^(3+2)


ans = 21880

1 + 5*3/6^2 + 2^(2-4) *1/5.5


ans = 1.4621



Problem 2.4

(a) The area of a circle is Define r as 5, then find the area of a circle, using MATLAB®.

r=5


r = 5


area=pi*r^2


area = 78.54


(b) The surface area of a sphere is . Find the surface area of a sphere with a radius of 10 ft.

r=10


r = 10

surface_area=4*pi*r^2


surface_area = 1256.6


(c) The volume of a sphere is 4/3pr2. Find the volume of a sphere with a radius of 2 ft.


r=2


r = 2

volume=4/3*pi*r^3


volume = 33.51



Problem 2.5
(a) The area of a square is the edge length squared (A = edge2). Define the edge length as 5, then find
the area of a square, using MATLAB®.

edge=5


edge = 5
4

Información del documento

Subido en
30 de diciembre de 2025
Número de páginas
258
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$22.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
PrepMart
4.8
(215)
Vendido
137
Seguidores
1
Artículos
2185
Última venta
1 día hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes