MATLAB Community

MATLAB, community & more

15 Questions: Grant Cook III

We will be celebrating the 15th Anniversary of MATLAB Central through October.  Our second interview in our 15 Questions series is with Grant Cook III.


Grant works for Halliburton and has been coming to MATLAB Central for about a decade.  He is a frequent participant on Cody with a reputation score over 21,000 points, which currently ranks 6th all time.

One of his better problem sets on Cody is “Divisible by X” which teaches interesting mathematical tricks that can be utilized to determine the divisibility of any given number by a range of divisors.

Thanks to Grant for agreeing to do this virtual interview.

1. John Kelly: When did you first get exposed to MATLAB and did you start using it right away, or did it take a while to grow on you?

Grant Cook III: I started using MATLAB in graduate school about a decade ago. I recall that some numerical methods and analysis classes exposed us to a broad range of problem-solving tools and methods, from C and C++ programming to Excel to MATLAB and Maple.  I found that MATLAB has the best combination of customizability and fixed structure to function very well as a robust sandbox for solving lots of problems, big and small. The program itself, and the many modules that can be added on, provide tools to solve a broad array of problems out of the box. On the other hand, the MATLAB programming language provides broad flexibility with many low-level code constructs abstracted out. That is to say, one does not have to be an expert programmer to significantly leverage the strengths of MATLAB.

2. JK: Did you get a reputation as a “MATLAB Fixer” at your organization? Was that ever a burden?

GC3: Actually, the guys at work have referred to me as “Mr. MATLAB” or “MATLAB incarnate” due to my extremely logical nature and use of MATLAB to solve most problems, ranging from simple composition calculations to bill-of-materials comparison and cost analysis across thousands of designs. I enjoy helping other engineers learn how MATLAB can extend analyses and solutions to a broad or large data set and have half-jokingly said, “If you’re going to do an analysis once, use Excel. If you’re going to do it more than once, use MATLAB.”

3. JK: Tell me about something interesting you have done with MATLAB.

GC3: As part of my doctoral research, I developed a comprehensive material selection procedure for a bonding process called partial transient liquid-phase (PTLP) bonding. (Article Part I and Part II) As part of this model, I digitized almost 2000 phase diagrams to create a thermodynamic database. The MATLAB routine that I developed used this database, along with some user-selected inputs, to determine all possible material combinations for bonding certain materials. Program outputs included temperature-composition plots for all possible combinations and certain prioritization tables that help determine which bond-material combinations are optimal.

4. JK: I understand you have biked across the western United States.  Can you tell me about that experience? Where did you go? How long did it take?

grant-cook-iii-bike-4 grant-cook-iii-bike-3

GC3: During the summers of 2009 and 2010 I toured parts of Utah, Nevada, California, and Arizona. I traveled up and down mountains, through canyons and multiple national parks, and along precipitous roads for five days each year. Despite being the middle of June for the 2010 trip, many of the mountain passes (some above 10,000 feet) were very cold; one dropped down to 45°F. On the other hand, one section through Arizona peaked at 111°F. Fortunately, those were on different days. I also endured many stiff headwinds, some reaching over 40 mph. While I had family along with me as a support crew for both trips, I biked the whole trip solo (no drafting). Other interesting data about these rides, including total pedal revolutions and a spec ad my brother created, are available here on my website.

5. JK: How did you incorporate MATLAB into your ride across the western US?

grant-cook-iii-bike-2 grant-cook-iii-bike-6

GC3: I had previously built a MATLAB routine to synthesize the csv files downloaded from my bike’s power meter. It made calculation and tabulation of minimum, maximum, summation, and average values very quick and easy. In addition, these arduous rides inspired me to determine just how much energy the mountains and winds were sapping. So, I wrote a routine in MATLAB based on a mathematical cycling power model to (1) determine accurate coefficient values for my bike setup based on a calibration ride, (2) back calculate my power output using data from the power meter other than power (e.g., wind speed, road grade), (3) correlate the actual and calculated power profiles, and (4) calculate how far I would have gone each ride had there been no wind and on flat ground. For my 2010 summer trip, these calculations showed that I would have gone almost 11% farther with no wind and at least 10% farther than that (21% total) on a windless flat stretch (e.g., in a velodrome). Additional details about this routine, and output plots from MATLAB, are also available here.

6. JK: When and why did you first decide to use MATLAB Central?

GC3: I’ve used MATLAB Answers and File Exchange off and on for years. However, I didn’t know about Cody until a little over a year ago when, ironically, a co-worker sent me a link to that site (due to how much I promoted MATLAB as a tool). I immediately loved the site and have created over 100 problems (2nd highest) and solved a majority of posted problems (over 1800).

7. JK: What are the greatest benefits you get out of using Cody?

GC3: Cody provides a fun and engaging platform for learning about MATLAB’s functionality and improving programming skills. I have repeatedly learned about core functions or programming methods that were new to me and which I have then implemented in my own MATLAB programs to improve their efficiency and/or make new analyses possible that I simply couldn’t do before.

8. What contribution are you most proud of?

GC3: Probably my Scrabble Scores set of problems on Cody. An introductory Cody problem (posted by MathWorks) started off with the simplest case of scoring words in a Scrabble game. I decided to continue that methodology and posted a series of more than ten problems that successively develops a routine until it can fully optimize scoring based on any given board setup and set of tiles.

9. JK: What do you think is the most valuable resource on MATLAB Central?

GC3: If the user has free time or wants to increase MATLAB/programming knowledge, Cody would be most valuable. It’s almost like taking an online programming course without having to pay or take tests. If the user has an immediate need, Answers is probably most valuable. If the user is developing a new program or routine, the File Exchange is a helpful starting point or springboard, as user-developed functions can save time and/or provide ideas about additional functionality that could be incorporated or more efficient methods of approaching a problem.

10. JK: What’s the number one piece of advice you would give to someone to improve their Cody problem?

GC3: People should play through existing problems to get a feel for what is out there—it can help them learn new things about MATLAB and programming while preventing problem duplication.

11. JK: Is there a problem on Cody you think everyone in the Community should already know the answer to?

GC3: The Cody Challenge provides a good starting point for anyone familiar with MATLAB (or programming). Many of the problems in this set are simple and they provide a good warm up to the rest of Cody.

12. JK: What’s the most surprising thing you’ve come across on MATLAB Central?

GC3: A user-contributed clickable-legend function

13. JK: You obviously have an extensive knowledge of MATLAB.  What would it take to motivate you to participate more in MATLAB Answers?

GC3: Perhaps more hours in the day. Between work, family, church, and current side projects (one of which is Cody), I don’t have much free time. I do utilize the Answers site a lot when I’m stumped on how to code something, and I’m very thankful for the site, but I’m not sure how I could fit in contributing to that site as well. Let me know when someone has posted a routine to the File Exchange that produces more hours per day (or more days per week, month, or year).

14. JK: What keeps you coming back to MATLAB Central?

GC3: Search engines.  Many answers to questions that come up during programming are found on the Answers site. I’d say I get directed to pages on Answers multiple times per week, on average, and sometimes multiple times on the same day. That’s pretty frequent, considering that I’ve been working as an engineer that does programming and not a full-time programmer.

15. JK: What’s one of your favorite non-software non-mathematical things to do?

GC3: Currently, create and post quizzes on I use MATLAB to develop and efficiently generate the back-end data for many of these quizzes which can be found here on the Sporcle site. I’ve posted a broad array of quizzes, including topics such as the Legend of Zelda, world flags sorted by color, clickable chess boards, blitz character or shape selection, crosswords, and the periodic table.


Thanks to Grant for taking the time to answer some questions.  Be sure to check back soon for another interesting interview.

If you have not done so already, please sign up for the 15th Anniversary Celebration for a chance to win some prizes including MATLAB T-Shirts.

15 Year Anniversary

  • print


To leave a comment, please click here to sign in to your MathWorks Account or create a new one.