Recap
You have learnt about creating and manipulating arrays (vectors and matrices) of numbers. This module considers arrays where the elements are characters rather than numbers.Strings
Strings are essential for labelling plots, and describing output. Strings are really just vectors of characters, so many vector operations can be performed on strings.
Objectives
The aim of this module is to understand how to create and manipulate strings in MATLAB and how to produce formatted output.
What you should know by the end of this module:
- how to create strings;
- string indexing;
- how to compare strings;
- how to write formatted output to the screen or a string;
Instructions
Work your way through the pages of this lesson using the links in the blue bar above or at the bottom of each page. You should do them in order initially but you can return to any of them when you need to refresh your memory. You can print the pages by using the printable copy icon in the Resources menu bar to the right.
Hint: Have both these lessons open in a web browser and MATLAB open in another window so you can try all the examples as you work through the lessons.
It is recommended that you attempt
the self-test exercises that you will find on each page. There is a
quiz at the end of the module for which you will receive a grade.
You final mark for this quiz will be the highest mark you achieve
before the due date for the quiz.