The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 399 Weeks Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
MATLAB Language!
For a biomedical experiment, the names and weights of some patients have been stored in a file patwts.dat. The file looks like this:
Darby George 166.2
Helen Dee 143.5
Giovanni Lupa 192.4
Cat Donovan 215.1
A????1A????1
Write a script readpatwts.m that will first attempt to open the file. If the file open is not successful, an error message should be printed. If it is successful, the script will read the data into strings one line at the time, save the weight into a vector, and meanwhile print each personA????1s name in the form A????1last, firstA????1 followed by the weight like the following format:
George, DarbyA????1s weight is 166.20 lbs.
Dee, HelenA????1s weight is 143.50 lbs.
Lupa, GiovanniA????1s weight is 192.40 lbs.
Donovan, CatA????1s weight is 215.10 lbs.
After finishing reading the file and printing, close the file and check whether the file is closed successfully. Finally, calculate the average weight, and print it like this:
The average weight is $153.08 lbs.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll