Page 11 - A Guide to MATLAB for Beginners and Experienced Users
P. 11

x         Contents


                          M-Book Graphics                                                    97
                          More Hints for Effective Use of M-Books                            98
                          A Warning                                                          99
                     7    MATLAB Programming                                                101
                          Branching                                                         101
                            Branching with if                                               102
                            Logical Expressions                                             104
                            Branching with switch                                           108
                          More about Loops                                                  109
                            Open-Ended Loops                                                110
                            Breaking from a Loop                                            111
                          Other Programming Commands                                        112
                            Subfunctions                                                    112
                            Commands for Parsing Input and Output                           112
                            User Input and Screen Output                                    114
                            Evaluation                                                      116
                            Debugging                                                       117
                          Interacting withthe Operating System                              118
                            Calling External Programs                                       118
                            File Input and Output                                           119
                     8    SIMULINK and GUIs                                                 121
                          SIMULINK                                                          121

                          Graphical User Interfaces (GUIs)                                  127
                            GUI Layout and GUIDE                                            127
                            Saving and Running a GUI                                        130
                            GUI Callback Functions                                          132
                     9    Applications                                                      136
                          Illuminating a Room                                               137
                            One 300-Watt Bulb                                               137
                            Two 150-Watt Bulbs                                              138
                            Three 100-Watt Bulbs                                            143
                          Mortgage Payments                                                 145
                          Monte Carlo Simulation                                            149
                          Population Dynamics                                               156
                            Exponential Growthand Decay                                     157
   6   7   8   9   10   11   12   13   14   15   16