Week+of+11-19+to+11-25

November 20th
Today I arrived at QuarkNet at 3:50. I dove straight into the next tab in the "Getting Started with MATLAB" help menu. This one was called "Workspace Variables", and it familiarized me with a new feature of MATLAB. Whichever variables you are currently working with are shown in a list in the Workspace in the upper left hand corner of MATLAB. That Workspace is just a visualization of the code which is stored when calculations are done in MATLAB. I decided to test out a few of the functions to do with variable storage. The first one I experimented with was "clear". It is shown below that once the clear function is used, every variable becomes undefined. I was curious about the full capability of this clear function, so decided to try to take it one step further. I remembered that in Java, many generic operation functions could be manipulated to only deal with a certain variable or group of variables. The way this worked in Java was to put the name of the variable you wanted to isolate in parenthesis after the command. I tried this, as shown below, but MATLAB asked for a string. So, I defaulted to Java's form of strings, using quotation marks, but that didn't work either. In fact, it appears that MATLAB doesn't ever accept quotation marks. So, as a last resort I tried apostrophes and discovered that strings in MATLAB are in fact referred to by using apostrophes. So, I was able to clear a while leaving b the same. Next I decided to look at the "whos" command. This command is pretty simple. As shown below, it displays some features of each of the variables in the workspace. The final note about variable storage and the Workspace in the "Workspace Variables" section is the ability to save and load. I decided to test out these commands with the three variables I had just called up with the "whos" command. So, I typed in the line and closed MATLAB. I reopened it to see the empty Workspace displayed below.

I then used the "load" command to recall my saved Workspace, and the result is shown beow. That's it for the Workspace Variables page. When I was in the middle of this, Dr. L came in and discussed with me a specific plan for moving forward with my MATLAB adventure. I typed the details of this conversation into a page linked into my Logbook called "MATLAB Goals". The next tab in the MATLAB "Getting Started with MATLAB" booklet was "Character Strings". I have my fair share of experience with strings due to a text based game I programmed for a semester project in Computer Programming II, so none of this was too shocking. The most significant thing to note is something I discovered above in my experimentation with clearing variables - where Java used quotation marks ("), MATLAB uses apostrophes ('), sometimes referred to as single quotation marks. Below is a picture that I will discuss. The first point I wanted to make was one about classification in MATLAB. I created a, b, and c expecting the classes would be int, double, and char. The reason I thought this is that I declared a as 1, which is an integer, b as 2.5, which involves a decimal and thus is a double, and c I created a sentence of letters which would be classified as characters. I was correct about the pertinent point right now, which is that strings' class shows up as "char" on the "whos" command breakdown, but I was wrong that 1 would be classified as int and I am guessing I will figure out the difference between integers and doubles in MATLAB further down the road. One other thing I wanted to show with this picture was how to create a string. Essentially, you can type whatever characters you want, group them between apostrophes, and store them together. The one interesting thing to note was that if your string involves an apostrophe, you must type two apostrophes in the code to denote one in the text. The failure to use a double apostrophe confuses MATLAB's formatting very much and the compiler is not happy with you, as shown by my failed attempt to create e. The next feature of strings addressed in the tutorial was the ability to combine strings. Below is a combination of strings c and d from the picture above. Grouping strings together is merely a matter of using brackets. It would have taken a little more forward planning on my part to account for the space that should have occurred after the exclamation point, the capitalization at the beginning of each sentence, or the punctuation at the end of the second sentence. The last feature of strings addressed in the tutorial is the conversion of numbers to strings. It is interesting to note that in Java, a number variable will automatically become a string if added into it using the + operator, but in MATLAB there are apparently multiple different commands for converting numbers to strings. One is shown below. After this variety of progress, I left QuarkNet today at 5:50.