MATLAB Excel Builder | ![]() ![]() |
Illustration 5: Calling mysum Four Different Ways
This illustration calls the function mysum
in four different ways. The first (cell A14) takes the values 1 through 10, adds them, and returns the result of 55. The second (cell A19) takes a range object that is a range of cells with the values 1 through 10, adds them, and returns the result of 55. The third (cell A24) takes several range objects, adds them, and returns the result of 120. This illustration demonstrates that the ranges do not need to be the same size and that all the cells do not have to have a value. The fourth (cell A30) takes a combination of a range object and explicitly stated values, adds them, and returns the result of 16.
Figure 4-12: Four Different Calls to mysum
This illustration runs when the Excel file is opened. To reactivate the illustration, make the appropriate cell active. Then press F2 followed by Enter.
![]() | Illustration 4: Calling myplot | Illustration 6: myprimes Macro | ![]() |