a. Import into MATLAB
the cartalk.txt file using readtable()
b. How many different entries are in this table? How may rows and
columns?
c. Write MATLAB code which will iterate through this table, and
display only the rows that have the area code 314, saving it to a
variable called STL_Cartalk_Entries.
d. Write MATLAB code which will sort alphabetically only these
STL_Cartalk_Entries. Use the sortrows() function.
.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------here is the txt-------------------------------------------
Aegean
Caterer Sue Flockey 660
5556766
Accounts Payable Clerk, Moscow Office Dasha
Chekhov 618 5557598
Accounts Receivable Supervisor from the Mumbai Office
Vishnu Payup 506 5559076
Adopted Son from Sweden Bjorn A. Payne Diaz
618 5553776
Airline Seat Tester Wilma Butfit
618 5557788
Air-Quality Monitor Carmine Dioxide
660 5551942
Air Traffic Controller Ulanda U. Lucky
618 5551612
Airline Reservation Manager Will Price
Randomly 506 5555015
Alaskan Prenuptial Advisor Rush Inuit
618 5557163
Alignment Inspector Lou Segusi
314 5552092
Alternative Fuel Consultant Amanda Livering
Cole 816 5557054
Anger Management Coach Kirsten Hollered
314 5555105
Anger Management Consultant Joanne
Slowburner 314 5552742
Animal Control Officer Turner Luce
506 5554482
Appalachian Chef Everett Possum
314 5554672
Appeals Specialist Bud Uronner
314 5550381
Appetizer Coordinator Barbara Ganush
314 5553978
Appointment Secretary Stu Earley
506 5555347
Appointment Secretary II Amadeus O. Early
506 5552724
Arbitration Expert Viola Fuss
816 5552765
Art Critic Phyllis Steen 816
5559350
Art Critic II Dot Snice 314
5554538
Asphalt Contractor Luciano Pavearoadi
618 5558557
Assertiveness Training Coach Lois Steem
314 5550141
Assistant Customer Care Representive Kurt
Reply 660 5558663
Asst. Directors of Computer Services Sy Burnett and Sy
Quest 816 5557695
Assistant Director of Moral Support Hugo
Gurll 618 5553769
Assistant to our Make Up Artist Gladys
Radio 618 5557984
Assistant Director of Strategic Planning Kent C.
Detrees 618 5559466
Assistant Disciplinarian Joaquin D'Planque
816 5555991
Asst. Fleet Manager Lisa Carr
660 5554211
Asst. Transportation Coordinator Orson
Buggy 618 5551584
Astoturf Installer Nomar Wheaton
618 5557319
Attorney General Janet Torino
816 5552121
Attorney General in charge of Tobacco Settlements
Hubert H. Humvee II 314 5550483
Audience Counter Hugh Wake 816
5553257
Audience Estimator Adam Illion
314 5554289
Audience Response Analyst Luke Warm
506 5556187
Australian Tour Guide Joaquin Matilda
506 5554880
Auto-Body Expert James Bondo
618 5559258
Automotive Finishes Consultant Rusty Steele
506 5557473
Automotive Medical Researcher Dr. Denton
Fender 618 5555159
Automotive Registrar Megan Model
660 5552996
Auto Seat Tester Fitz Matush
618 5550063
Back Seat Driver Veronica Lizzioncourse
660 5559191
Back Seat Driver II Mischa Turnov
660 5554072
Bad Joke Interpreter Nadia Geddit
618 5559522
Bail Bond Provider Freida Gogh
618 5551504
Bail-Bondswoman Frieda Wander
816 5552371
Band Leader Sasha Noyes 506
5554587
Banker, Car Talk Plaza Poker Games Nikolai
Putin 506 5551971
Bathroom Tile Installer Lotta Bullnose
816 5559237
Bean Counter Ed Amame 618
5559457
Bedtime Storyteller Juan Zapata
660 5553453
Behavior Consultant Wyatt B. Hoovesia
660 5553220
Biblical Scholar Vera Lee Isay
660 5555706
Big Band Leader Juan Anatou 816
5558743
Blues Coordinator Mahamadan Ptolemy
506 5555179
Bob Dylan Specialist I. Shelby Released
618 5558392
Bolt Tightener Tilda Plierslip
506 5554763
Book Critic Odessa Paige Turner
816 5550090
Boston Funeral Director Hadley Newham
506 5559275
Bowling Coach Menachem Down 660
5552528
Brake Adjuster Schlomo Quigley
816 5552464
Breathalyzer Administrator Eureka Garlic
618 5554702
British Cutlery Specialist Sir Irving Spoon
506 5558020
British Doorman Isaiah Olchap
618 5552764
Brother in the Military Major Payne-Diaz
506 5557069
Boston Traffic Director Laura Biden
314 5557589
Budget Director Sasha Titus 660
5551576
Bunji Jumping Instructor Hugo First
506 5556352
Butler in Car Talk's Scotland Division Angus
MacCoatup 816 5552032
Broadcast Philosopher Phillip Airtime
618 5559072
Business Forecaster Luigi Bord
816 5556445
Cabinet Maker L. Ron Cupboard
618 5557543
Caffeine Addiction Counselor Bruno Moore
506 5550413
Car Stereo Installer Carlos Antenna
618 5553278
Car Talk Bouncer Euripedes Ibreakayourface
506 5556096
Car Talk Ice Rink Manager Sam Boney
816 5555522
Car Talk Opera Critic Barbara Seville
506 5552508
Celebrity Consultants Richard Gere-Oil, Mick
Jaguar 816 5552598
Chairman, Federal Lubrication Board Alan
Greasepan 506 5554498
Chairman, Joint Chiefs of Staff John
Shall-I-Pop-a-Wheelie 506 5551207
Chairman, Math Dept. Horatio Algebra
314 5559033
Chairman of our Southern Literature Department Amos
Reid 618 5552488
Chairman, Oral History Dept. Ira Caull
816 5557952
Chairman, Staff Physics Dept. Victor
Analysis 314 5554533
Chairman, Underemployment Study Group Art
Majors 314 5554610
Chicken Soup Provisioner Kent Hoyt
660 5559794
Chief Accountant Candace B. Rittenoff
816 5553922
Chief Benefactor Myra Chunkle
660 5558691
Chief Cook and Bottle Washer Chef Boyar
Ubusy 660 5557684
Chief Estimator Edward James Almost
506 5553856
Chief Information Officer Otto Delupe
660 5556619
Chief Justice Harry Mental, aka Judge
Mental 618 5553260
Chief Legal Counsel Hugh Louis Dewey of Dewey, Cheetham
& Howe 816 5555508
Chief Negotiator Bernadette Bridge
314 5557033
Chief of Stadium Seating for the Olympics Wayne
Back 816 5553559
Chief Procrastinator Juan Menudo
506 5552346
Chief Procrastinator, Paris Office Jacques
Hughes 618 5550774
Chief Procurement Officer Emma Chizzit
618 5552141
Chief of Tire Technology Yessir Itsaflat
660 5550175
Child Care Provider A. Hugh Nokitov
506 5552139
Child Development Expert Dr. Benjamin Spark
816 5553679
Child Transportation Specialist Minnie Van
Driver 660 5556983
Children's Menu Adviser Bea Ferrone
660 5552871
Children's Music Programmer Al Lowetta
314 5558023
Children's Sleepover Coordinator Amos
Muhmahmi 618 5558041
Cigar Smoke Monitor Anna Paulina Roma
314 5558671
Class Attendance Monitor Julie Verley
816 5550386
Class Valedictorian Sidney Furst Rowe
816 5552935
Cleanliness Inspector Adolph Deflor
816 5550324
Cliché Monitor Saul Wellingood
660 5550109
Climate Change Monitor Jillian Here
816 5551078
Clock Watcher Colette O'Day 660
5552730
Clothing Designer Hugh Jass 314
5550256
Co-Chairmen of Apathy Study Group Ben Thayer, Don
Thatt 660 5558686
Collections Specialist Colin Duboise
506 5557810
Collision Repair Specialist Jesse "The Body Shop"
Ventura 660 5552585
Commencement Speaker Gladys Overwith
506 5550550
Communications Director George
Stayontopothis 314 5555318
Communications Director II Noam Sayin
618 5551554
Communications Specialist, Rome Office Kay C.
Deech 314 5553700
Compassion Coordinator Ophelia Paine
314 5559159
Complaint Line Operator Xavier Breath
660 5556147
Complaint Resolution Specialist Billy Aiken
660 5551914
Computer Hardware Specialist C. Colin
Backslash 816 5550899
Computer Instructor C. Boynton Glick
506 5556617
Conductor Emeritus, Tappet Brothers Symphony Orchestra
Sludgy Ozawa 660 5558706
Conductor, Tappet Brothers Symphony Orchestra Philip
Harmonic 660 5558590
Conflict Resolution Specialist Hugo Origo
314 5550353
% Number of entries is equal to number of rows which is stored in 'numRows' in this program
% Number of columns is stored in 'numColumns'
% 'sorted' contains alphabetically sorted STL_Cartalk_Entries
T = readtable('cartalk.txt','Delimiter','\t'); % Reading the
table into variable T
sizeOfTable = size(T); % Size of table T
numRows = sizeOfTable(1); % Number of rows in table T
numColumns = sizeOfTable(2); % Number of columns in table T
areaCodes = T{:,'Var3'}; % Extracts only the area codes from table
T
indexes = []; % Initialisation of vector which will store all the
row indices with area code=314
for i=1:numRows % Iterating over every row in area codes
if (areaCodes(i) == 314) % Checking if the current row has area
code=314
indexes = [indexes i]; % If the check returns successful, that row
number is added to the vector indexes
end
end
disp('Displaying all the rows of T which have area
code=314');
disp(T(indexes,:)); % Displaying all the rows of T which have area
code=314
STL_Cartalk_Entries = T(indexes,:); % Storing the rows with area
code=314 into STL_Cartalk_Entries
sorted = sortrows(STL_Cartalk_Entries); % Sorting
STL_Cartalk_Entries alphabetically
TIL L LL T = readtable ('cartalk.txt', 'Delimiter','\t'); ? Reading the table into variable T sizeofTable = size (T); % Size of table T numrows = sizeofTable (1); % Number of rows in table T numColumns = sizeofTable (2); % Number of columns in table T areaCodes = T{:, 'Var3'}; % Extracts only the area codes from table T indexes = []; & Initialisation of vector which will store all the row indices with area code=314 for i=1:numRows % Iterating over every row in area codes if (areaCodes (i) == 314) & Checking if the current row has area code=314 indexes = [indexes i]; If the check returns successful, that row number is added to the vector indexes end end disp('Displaying all the rows of T which have area code=314'); disp (T(indexes, :)); % Displaying all the rows of T which have area code=314 STL_Cartalk_Entries = T(indexes, :); % Storing the rows with area code=314 into STL_Cartalk_Entries sorted = sortrows (STL_Cartalk_Entries); % Sorting STL_Cartalk_Entries alphabetically
>> SecondLast Displaying all the rows of T which have area code=314 Var1 Var2 Var3 Var4 'Assertiveness Training Coach' 'Anger Management Coach' 'Children's Music Programmer' 'Lois Steem' 'Kirsten Hollered' 'Al Lowetta' 314 314 314 5.5501e+06 5.5551e+06 5.558e+06 >> numRowS numrows = >> numColumns numColumns = >> sorted sorted = 3x4 table Var1 Var2 Var3 Var4 'Anger Management Coach' 'Assertiveness Training Coach' 'Children's Music Programmer' 'Kirsten Hollered' 'Lois Steem' 'Al Lowetta' 314 5.5551e+06 5.5501e+06 5.558e+06
a. Import into MATLAB the cartalk.txt file using readtable() b. How many different entries are in...