Week+of+3-18+to+3-24

The approach I will settle on is to create one handle that keeps track of the number of lines that should be on the graph, one handle that contains a matrix of the different vectors of x values, one that contains the y in the same fashion, and one handle containing a cell array that keeps track of the colors. After grappling with a number of errors about the way I was indexing and assigning values to the matrices, I almost scrapped this entire project. At one point I even tried splitting the work for plotting the lines into two functions, one that calculated them all and one that plotted them, but that proved to be quite unhelpful (I promise the initial idea made sense but I encountered far too many errors to overcome). I had messed with the code so much that it would take so long to get it back to where it was before I started trying to get these buttons to work that it just wouldn't be worth it. I decided to just follow one last little lead to its bitter end, and lo and behold I got the program back online. With this simpler approach, it turned out my biggest problem was struggling to properly communicate with MATLAB about what I wanted to do with the arrays and running into a few problems with how to alter the matrices the way I wanted to. After hunting around on Google and forums for a while (I feel like I can only find what I'm looking for 10% of the time with those) I finally got the syntax and the logic down. Right now my GUI is fully functional at changing slope, y-intercept, x and y axes (via scale and center), and color of the line, as well as being able to keep old lines and reset. I also decided to add the grid (simply with the 'grid on' line before graphing) and to add thick lines for the x and y axes (y=0 and x=0). I did this by plotting lines that were a long set of values in one direction and a same-length vector full of zeros in the other direction. Then, I thickened each line by setting the 'LineWidth' property of each of those lines. I did some other housecleaning with the program as well. For example, the way I had things written before, the x-values used to compute the plot were dynamically based on the xmin and xmax that the window could handle. I cannot have that anymore because if I keep one line and then re-scale the axes, the window might be larger than the old line since it was made to fit the smaller window. The only way I could imagine to fix that was just to make the x values go from -n to n and possibly change n if I see it fit depending on how capable I make the program of handling larger lines. The last change I would like to make to this GUI will be in next week's post, which is to have an interactive way (likely pop-up dialog boxes) to let the user change the limits of the sliders. Since I will be making that change to the GUI script next week, I will show the final script then, but since I can't imagine that change causing any significant differences, if any, in the controlling function, I have posted an essential final copy of it below. Below is a screencast that attempts to show all of the current capabilities of this GUI.

http://screencast.com/t/Y1WtSxoms60