Introduction to MAT g g
LABfor Engineers a
g g g
nd Scientists
g
Solutions for Numerical Computation a
g g g g
nd Modeling
g
—
Sandeep Nagar
g
, Introduction to g g
MATLAB for En g g
gineers and Sci g g
entists
Solutions for Numerical Co
g g g
mputation and Modeling
g g
Sandeep Nagar
g
,IntroductiongtogMATLABgforgEngineersgandgScientists:gSolutionsgforgNumeri
calgComputationgandgModeling
SandeepgNagargNe
wgYork,gUSA
ISBN-13g(pbk):g978-1-4842-3188-3 ISBN-13g (electronic):g 978-1-4842-3189-0
https://doi.org/10.1007/978-1-4842-3189-
0g LibrarygofgCongressgControlgNumber:g2017960
835gCopyrightg©g2017gbygSandeepgNaga
r
Thisgworkgisgsubjectgtogcopyright.gAllgrightsgaregreservedgbygthegPublisher,gwhethergthegwholegor
partgofgthegmaterialgisgconcerned, gspecificallygthegrightsgofgtranslation,greprinting,greusegofgill
ustrations,grecitation,gbroadcasting,greproductiongongmicrofilmsgorginganygothergphysicalgway,g
andg transmissiong org informationg storageg andg retrieval,g electronicg adaptation,g computerg software,
g orgbygsimilargorgdissimilar gmethodologygnowgknowngorghereaftergdeveloped.
Trademarkedgnames,glogos,gandgimagesgmaygappeargingthisgbook.gRathergthangusegagtrademarkg
symbolg withg everyg occurrenceg ofg ag trademarkedg name,g logo,g org imageg weg useg theg names,g logos,g
andgimagesgonlygingangeditorialgfashiongandgtogthegbenefitgofgthegtrademarkgowner,gwithgnogint
entiongofginfringementgofgthegtrademark.
Theg useg ing thisg publicationg ofg tradeg names,g trademarks,g serviceg marks,g andg similarg terms,g eveng i
fgtheyg areg notg identifiedg asg such,g isg notg tog beg takeng asg ang expressiong ofg opiniong asg tog whetherg org
notgtheygaregsubjectgtogproprietarygrights.
Whilegthegadvicegandginformationgingthisgbookgaregbelievedgtogbegtruegandgaccurategatgthegdategof
gpublication, gneithergthegauthorsgnorgthegeditorsgnorgthegpublishergcangacceptganyglegalgresponsib
ilitygforganygerrorsgorgomissionsgthatgmaygbegmade.gThegpublishergmakesgnogwarranty,gexpressgo
rgimplied,gwithgrespectgtogthegmaterialgcontainedgherein.
CovergimagegbygFreepikg(www.freepik.com)
ManaginggDirector:gWelmoedgSpahrgE
ditorialgDirector:gToddgGreengAcquisit
ionsgEditor:gStevegAnglingDevelopmen
tgEditor:gMatthewgMoodiegTechnicalgR
eviewer:gMassimogNardonegCoordinati
nggEditor:gMarkgPowersgCopygEditor:g
KeziagEndsley
DistributedgtogthegbookgtradegworldwidegbygSpringergScience+BusinessgMediagNewgYork,
233gSpringgStreet,g6thgFloor,gNewgYork,gNYg10013.gPhoneg1-800-SPRINGER,gfaxg(201)g348-
4505,ge-mailgorders-ny@springer-
sbm.com,gorgvisitgwww.springeronline.com.gApressgMedia,gLLCgisgagCaliforniagLLCgandgthegso
legmemberg(owner)gisgSpringergScienceg+gBusinessgMediagFinancegIncg(SSBMgFinancegInc).gS
SBMgFinancegIncgisgagDelawaregcorporation.
Forg informationg ong translations,g pleaseg e-
mailg ,g org visitg http://www.apress.gcom/rights-permissions.
Apressgtitlesgmaygbegpurchasedgingbulkgforgacademic,gcorporate,gorgpromotionalguse.geBookgve
rsionsg andg licensesg areg alsog availableg forg mostg titles.g Forg moreg information,g referenceg ourg Printga
ndgeBookgBulkgSalesgwebgpagegatghttp://www.apress.com/bulk-sales.
Anyg sourceg codeg org otherg supplementaryg materialg referencedg byg theg authorg ing thisg bookg isg availabl
egtogreadersgongGitHubgviagthegbook'sgproductgpage,glocatedgatgwww.apress.com/97814842318
83.gForgmoregdetailedginformation,gpleasegvisitghttp://www.apress.com/source-code.
Printedg ong acid-freeg paper
, Dedicated to my wife Rashmi and my daughter Aliya
g g g g g g g g
LABfor Engineers a
g g g
nd Scientists
g
Solutions for Numerical Computation a
g g g g
nd Modeling
g
—
Sandeep Nagar
g
, Introduction to g g
MATLAB for En g g
gineers and Sci g g
entists
Solutions for Numerical Co
g g g
mputation and Modeling
g g
Sandeep Nagar
g
,IntroductiongtogMATLABgforgEngineersgandgScientists:gSolutionsgforgNumeri
calgComputationgandgModeling
SandeepgNagargNe
wgYork,gUSA
ISBN-13g(pbk):g978-1-4842-3188-3 ISBN-13g (electronic):g 978-1-4842-3189-0
https://doi.org/10.1007/978-1-4842-3189-
0g LibrarygofgCongressgControlgNumber:g2017960
835gCopyrightg©g2017gbygSandeepgNaga
r
Thisgworkgisgsubjectgtogcopyright.gAllgrightsgaregreservedgbygthegPublisher,gwhethergthegwholegor
partgofgthegmaterialgisgconcerned, gspecificallygthegrightsgofgtranslation,greprinting,greusegofgill
ustrations,grecitation,gbroadcasting,greproductiongongmicrofilmsgorginganygothergphysicalgway,g
andg transmissiong org informationg storageg andg retrieval,g electronicg adaptation,g computerg software,
g orgbygsimilargorgdissimilar gmethodologygnowgknowngorghereaftergdeveloped.
Trademarkedgnames,glogos,gandgimagesgmaygappeargingthisgbook.gRathergthangusegagtrademarkg
symbolg withg everyg occurrenceg ofg ag trademarkedg name,g logo,g org imageg weg useg theg names,g logos,g
andgimagesgonlygingangeditorialgfashiongandgtogthegbenefitgofgthegtrademarkgowner,gwithgnogint
entiongofginfringementgofgthegtrademark.
Theg useg ing thisg publicationg ofg tradeg names,g trademarks,g serviceg marks,g andg similarg terms,g eveng i
fgtheyg areg notg identifiedg asg such,g isg notg tog beg takeng asg ang expressiong ofg opiniong asg tog whetherg org
notgtheygaregsubjectgtogproprietarygrights.
Whilegthegadvicegandginformationgingthisgbookgaregbelievedgtogbegtruegandgaccurategatgthegdategof
gpublication, gneithergthegauthorsgnorgthegeditorsgnorgthegpublishergcangacceptganyglegalgresponsib
ilitygforganygerrorsgorgomissionsgthatgmaygbegmade.gThegpublishergmakesgnogwarranty,gexpressgo
rgimplied,gwithgrespectgtogthegmaterialgcontainedgherein.
CovergimagegbygFreepikg(www.freepik.com)
ManaginggDirector:gWelmoedgSpahrgE
ditorialgDirector:gToddgGreengAcquisit
ionsgEditor:gStevegAnglingDevelopmen
tgEditor:gMatthewgMoodiegTechnicalgR
eviewer:gMassimogNardonegCoordinati
nggEditor:gMarkgPowersgCopygEditor:g
KeziagEndsley
DistributedgtogthegbookgtradegworldwidegbygSpringergScience+BusinessgMediagNewgYork,
233gSpringgStreet,g6thgFloor,gNewgYork,gNYg10013.gPhoneg1-800-SPRINGER,gfaxg(201)g348-
4505,ge-mailgorders-ny@springer-
sbm.com,gorgvisitgwww.springeronline.com.gApressgMedia,gLLCgisgagCaliforniagLLCgandgthegso
legmemberg(owner)gisgSpringergScienceg+gBusinessgMediagFinancegIncg(SSBMgFinancegInc).gS
SBMgFinancegIncgisgagDelawaregcorporation.
Forg informationg ong translations,g pleaseg e-
mailg ,g org visitg http://www.apress.gcom/rights-permissions.
Apressgtitlesgmaygbegpurchasedgingbulkgforgacademic,gcorporate,gorgpromotionalguse.geBookgve
rsionsg andg licensesg areg alsog availableg forg mostg titles.g Forg moreg information,g referenceg ourg Printga
ndgeBookgBulkgSalesgwebgpagegatghttp://www.apress.com/bulk-sales.
Anyg sourceg codeg org otherg supplementaryg materialg referencedg byg theg authorg ing thisg bookg isg availabl
egtogreadersgongGitHubgviagthegbook'sgproductgpage,glocatedgatgwww.apress.com/97814842318
83.gForgmoregdetailedginformation,gpleasegvisitghttp://www.apress.com/source-code.
Printedg ong acid-freeg paper
, Dedicated to my wife Rashmi and my daughter Aliya
g g g g g g g g