Today I had a chicken wrap for lunch with -- you guessed it -- Matlab. Though the food was delicious, I admit the conversation was a little lacking. You see, Matlab is not a suave gentleman but a interactive computations and graphics program. Matlab's name stands for "matrix laboratory," and so, unsurprisingly, is especially proficient at matrix computations and manipulations. I've been spending the last few days exploring the basics of Matlab and familiarizing myself with its operations. I've discovered Matlab is somewhat like a glorified calculator. Both are used to solve mathematical problems and can be programmed to do specific things.
True to its name, Matlab's basic data element is the matrix array. Essentially, it computes everything as if it were in or part of a matrix. Addtionally, it solves problems numerically, not symbolically, which differentiates it from other programs such as Maple or Mathematica. Understanding this, I can begin to see the unique ways of using Matlab to solve problems.
For example, suppose I wish to graph the function y=f(x). If I set x to be a vector with linearly spaced entries, it can be regarded as a sort of one-dimensional grid that y can be graphed on. To do this, I simply set the array "x," then create "y" as another array whose values are the function of x's values.
To illustrate:
If I type the following into the command window,
>> x = (0:.05:2*pi);
>> y = cos(x);
>> plot(x,y)
I get the graph,
Pretty cool, right?
"Hold up, Lu!" you might be thinking. " What happened to all that whole spiel about predicting the future?" But don't worry. I haven't forgotten about about my hopes of predicting the stock market. Rather, before I attempt any such forecasts, I must first understand the program I'll be using to make predictive models: Matlab. Patience, everyone. One step at a time.
No comments:
Post a Comment