CS112: Lab 6 :: cftool, for loops and functions
Using cftool

MATLAB's interactive curve fitting tutorial is a good place to start.
Type cftool in MATLAB's command window. Then type load census to load in some data (that is predefined in MATLAB).
We'll work through the highlights of the tutorial to learn how to use the Curve Fitting Toolbox.
Practice with for loops and functions
Write a function called starline
that produces a string of asterisks as specified
by user input. The header of the function will look like this:
function stars = starline(len)
Here are some sample executions of starline:
>>
>> bar8 = starline(8)
bar8 =
********
>>
>> bar4 = starline(4)
bar4 =
****
>>
>> singlestar = starline(1)
singlestar =
*
>>
>>
>> nostar = starline(0)
nostar =
''
>>
>> negativestar = starline(-2)
negativestar =
''
>>
Prelude to Assignment 4
Assignment 4 contains two Exercises to complete before you tackle the problems. You'll write your own MATLAB functions:
ubbi.m and spin.m.
Click here for the Exercises.
Uploading your saved work
Use Fetch to upload your saved work.
Work-in-progress should go into your personal cs112/ folder.