%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. %| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. | %| | ____ ____ | || | __ | || | _________ | || | _____ | || | __ | || | ______ | | %| ||_ \ / _|| || | / \ | || | | _ _ | | || | |_ _| | || | / \ | || | |_ _ \ | | %| | | \/ | | || | / /\ \ | || | |_/ | | \_| | || | | | | || | / /\ \ | || | | |_) | | | %| | | |\ /| | | || | / ____ \ | || | | | | || | | | _ | || | / ____ \ | || | | __'. | | %| | _| |_\/_| |_ | || | _/ / \ \_ | || | _| |_ | || | _| |__/ | | || | _/ / \ \_ | || | _| |__) | | | %| ||_____||_____|| || ||____| |____|| || | |_____| | || | |________| | || ||____| |____|| || | |_______/ | | %| | | || | | || | | || | | || | | || | | | %| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' | % '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' % .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. %| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. | %| | ______ | || | ____ | || | ____ | || | _________ | || | ______ | || | __ | || | ____ ____ | || | ______ | | %| | |_ _ \ | || | .' `. | || | .' `. | || | | _ _ | | || | .' ___ | | || | / \ | || ||_ \ / _|| || | |_ __ \ | | %| | | |_) | | || | / .--. \ | || | / .--. \ | || | |_/ | | \_| | || | / .' \_| | || | / /\ \ | || | | \/ | | || | | |__) | | | %| | | __'. | || | | | | | | || | | | | | | || | | | | || | | | | || | / ____ \ | || | | |\ /| | | || | | ___/ | | %| | _| |__) | | || | \ `--' / | || | \ `--' / | || | _| |_ | || | \ `.___.'\ | || | _/ / \ \_ | || | _| |_\/_| |_ | || | _| |_ | | %| | |_______/ | || | `.____.' | || | `.____.' | || | |_____| | || | `._____.' | || ||____| |____|| || ||_____||_____|| || | |_____| | | %| | | || | | || | | || | | || | | || | | || | | || | | | %| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' | % '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Welcome to the octave bootcamp. Before starting to learn Octave programming, % You should familiarize yourself with the following areas of the Octave % environment: % 1) The 'Command Window'- This is used for entering commands, diplaying outputs, % and rendering warning and error messages. % 2) The 'Editor' Window- The editor is used or storing 'scripts', like the file, % which are used to store code for later use. % 3) The Command History Window- This window holds a list of previously run % commands, acting as a 'diary' for your activity in octave. % 4) Workspace- This window displays your stored variables. % 5) File Browser- This window works like your normal file browsing system, % allowing you to find and open files. % The text that follows is meant to help you to become familiar with using octave % and to introduce you to some basic operations. Text preceeded by a percent % sign and highlighted in green (like you are reading now) serves as the % written text. Lines of code will appear in yellow, red, and black text as % shown below. %Individual lines or sections of code can be run from this script by %highlighting them and pressing F9. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % LESSON 1: CALCULATIONS WITH OCTAVE % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Octave is capable of any arithmetic calculations that you can imagine: 2+3 8-4 5*100 60/3 % As you would expect, Octave follows all mathematical rules, including the % order of operations. 2+3*2^2 (15+5)*2 % We can also create variables to store the answers to our arithmetic operations. % a variable can be defined by assigning the result of an arithmetic calculation % to a letter or string: x=(4+4)/2^2 nameYourVariableAnything=99; % You can display what is stored in a variable using the display function: disp(nameYourVariableAnything); % Or by simply typing the variable name: nameYourVariableAnything %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % BEST PRACTICE % % It is VERY IMPORTANT to note that variable names are case-sensitive and that % failing to use the proper case will result in an error: disp(nameyourvariableanyting); % Best practices in programming dictate that variable names should: % 1) Be Meaningful- "hours_worked" is a more meaningful name than "X" % 2) Be Sufficiently Long- Names that are too long take too long to type and cause % clutter in your code. However, names that are too short can by cryptic to % others reading your code if they provide too little information. Thus, shorter % variable names are not always better. It is up to you to find the balance. % 3) Follow canonical naming rules- It helps to use delimiters or the letter- % case to separate individual words in the variable name. "hours_worked" uses % the underscore as a delimiter, while "HoursWorked" uses the upper case for the % Start of each word. % If we follow the MATLAB practices for Octave, then we should draw our rules % from JAVA naming conventions, which uses a Mixed-Case scheme where the first % letter is lower-case and the start of each subsequent word is upper case. % This is exemplified in our example: nameYourVariableAnything % Here is an article on MATLAB programming style: % 1) http://www.mathworks.com/matlabcentral/fileexchange/2529-matlab-programming-style-guidelines %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % You will notice when we run our commands, that the outcome is displayed in % the command window. We can suppress this output by adding a semicolon to the % statement. Try running the command again, but this time with a semicolon at % the end: x=(4+4)/2^2; % NOTE: If the command window ever gets cluttered, we can clear it: clc %stands for clear command % Commands also exist for mathematical constants, such as pi. By default, four % decimal places of pi are displayed: pi % Despite showing 4 significant digits,calculations are carried out to many more % significant digits. We can display numbers with greater or lesser precision % by chaning the numerical formatting: format long; pi format bank; pi format short; pi % Octave has many build in functions that can be used to assist in calculations: sqrt(64) % These functions can be run alone, but can also be nested within other commands: 8*sqrt(64) % Other examples are as follows: %e^x: exp(1) %natural log: log(e) % common log (base 10):\ log10(10^3) %cosine: cos(pi) % NOTE: Octave has many more functions than we can exhaustively list here. % You can find almost any operation that you can perform with a scientific or % graphing calculator as well as many more functions related to common % operations in statistics, signal processing, etc. For this reason, it is best % to practice looking at the help regularly and trying to first find useful % functions rather than trying to program each new operation yourself. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % EXERCISE % % Work with the person next to you to practice entering arithmetic calculations % into the script file and command window. Take turns providing one another % with simple math problems and solving them in octave. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Congratulations, Lesson 1 is complete! One last thing, though. In some cases % you may be working with variables in your workspace and want to come back to % these variables at a later timepoint. To save these variables we use the save % command, followed by a file name: save Lesson1 % "Lesson1" is our file name. % NOTE: WE MAY NOT BE ABLE TO RUN THESE COMMANDS DUE TO NIH ADMIN RIGHTS: % We can also provide a specific save location if desired: mkdir('C:\OctaveCourse') % make (mk) a new directory(dir) for the course save ('C:\OctaveCourse\Lesson1') %Save to our new location cd('C:\OctaveCourse') %change(c) to this directory(d) to see our file. % You can see the file in the file browser window. % Now we can clear the workspace of extraneous variables, if we want: clear all % When desired, we can also re-load our variables to use them again: load ('C:\OctaveCourse\Lesson1') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % LESSON 2: MATRICES % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Vectors and matrices are critical elements in Octave. A vector is defined as % a one-dimensional array, while matrices can have multiple dimensions. For % example, a single row or column of numbers would be considered a vector. % Vectors are defined by a pair of brackets (i.e, [ ]) and can contain numbers % or strings. You may also hear us refer to vectors and matrices as 'arrays'. % an array is simply a vector or matrix with a fixed number of elements. %NOTE: While numbers and strings can be contained together within certain % special types of vectors or matrices, it is simplest when first learning % Octave to assume that these two should not be stored together. %Rows: rowVector=[4 2]; alsoARowVector= [2,6]; %Columns: columnVector=[1;2;3;4]; % Strings: stringVector=['Hello', 'World']; stringColVector=['World';'Hello']; % We can also create matrices with both rows and colums: myMatrix= [1,2,3,4;5,6,7,8] % In Octave, you can display your matrix in the Command Window using the % same display command that we learned previously: disp(myMatrix); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % EXERCISE % % Now try creating your own matrix of numbers with 3 rows and columns. Just be % % certain each row has the same number of elements or you will receive and % % error: badMatrix=[2 3 4;1; 5,6,7]; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Once stored in memory, we can perform any number of mathematical operations on % our stored matrices: disp(myMatrix) myMatrix=myMatrix+1; disp(myMatrix) % You will probably all remember that the rules for matrix multiplication are % somewhat complicated. In neuroscience, we often use these matrices to store % data, but want to treat each entry as an individual element. So, while the % rules of matrix algebra still apply in Octave, you can also perform % perform multiplication and division in Octave on an element-by-element basis % using the period (.) operator before the multiply (.*) or divide (./) commmand % This operator tells matlab that you are conducting an 'array operation' and % not a 'Matrix operation'. myMatrix=myMatrix./2 myMatrix=myMatrix.*4 % Now try removing the operator from before the multiple and divide commands and % running the command again. You will notice that in some cases, this makes % no difference. However, if we were to try to multiply all of the numbers in % one matrix by each number in another matrix, the period operator could be % critical to returning the correct result: % In some cases, you may simply receive an error: a=[1,2,3,4] b=[1,2,3,4] a*b % returns an error. These matrices are incompatible for multiplication. % or a.*b % In others, you may return an answer other than what you intended: a=[1,2,3;4,5,6;7,8,9]; b=[1,2,3;4,5,6;7,8,9]; c=a*b c=a.*b % It is also worth noting that Octave has a number of built in functions to % create useful arrays. Each of these functions uses a similar syntax, with the % function name followed by the number of rows and columns to create an NxM % matrix of numbers. You can also enter only a single number to create a square % matrix of size NxN.These special arrays are as follows: % The identity matrix: eye(12,12) % OR eye(12) %Square 12 x 12 identity matrix % An array filled with ones: ones(8,10) %(useful for logical operations; to be discussed later) % An array filled with zeros: zeros(10) % This is useful for pre-allocating arrays or logical operations % An array of random numbers between 0 and 1 myRandomArray= rand(10,1) % We can change the range of the random numbers by multiplying by our desired % Maximum number: rangeZeroToHundred=rand(10,1).*100 % An array of random, but normally distributed numbers: normalRand=randn(10,1)*100 % You may also find it useful to fill a matrix or vector with a series of numbers. %To do this, we use the colon (:) operator, as follows: countingUp=1:100; disp(countingUp) % Notice that by default, this creates a column vector. This can be changed by % transposing the array using an apostrophe operator. countingUp=countingUp' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % EXERCISE % % PART I: % Can you save the variables from Lesson 2 using the commands we learned in % Lesson 1? Can you do it without looking back at the code? %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % LESSON 3: INDEXING % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Each location in a vector or matrix has a 'physical address' of sorts. We call % this location reference an index. The format for this address is the variable % name followed by the row number and column number. In the example below, we % first display the entire Matrix called 'MyMatrix'. Then, we reference the % number 2 in the matrix, which is located in row 1, column 2. Putting it all % together we get, "myMatrix(Row,Column)": myMatrix= [1,2,3,4;5,6,7,8] disp(myMatrix) myMatrix(1,2) % We can also return all of the numbers in a row or column by using the colon % operator instead of a single number. For example: myMatrix (1,:) % OR myMatrix (:,4) % We can also access the (i)th element in a matrix by providing a single index. % Indices using a single element count in a column-wise fasion. In other words, % We count starting at the first row of the first column, until the last row in % that column, and then begin incrementing again at the first row of the next % column. Try this for yourself and don't be afraid to play around a bit: myMatrix (4) % Another form of indexing to be aware of is logical or relational indexing. % Relational indexing uses the following operators: % == (equal to) % ~= (not equal to) % < (less than) % > (greater than) % <= (less than or equal to) >= (greater than or equal to) % Logical indexing uses the following operators: % & or && (AND) % | or || (OR) % ~ (NOT) % Relational operators will return a logical array with a True (1) for all % indices which meet a given condition and False(0) for those that do not. logicalArray=myMatrix(:,:)==6 logicalArray=myMatrix >=4 logicalArray=myMatrix <4 % We can find the union or intersection of multiple sets by using the logical % operators: logicalArray=(myMatrix>=4 & myMatrix<=6) % Or is necessary, we can find the inverse of our logic by using the NOT operator logicalArray=~(myMatrix>=4 & myMatrix<=6) % These statements can be as complex as necessary to get the job done: logicalArray=(myMatrix>=4 & myMatrix<=6 & myMatrix~=5) % The ABSOLUTE COOLEST part about logical arrays(vectors or matrices), is that % these arrays can then be used to index your original variable and extract the % desired data: myLogicalExtraction=myMatrix(logicalArray); % INDEXING STRINGS: % We can also index arrays of strings. Strings can be stored in character arrays % or in cell, arrays, so let's look at an example of each: myStringVar='Hello World'; myCellArray={'Hello World'}; % Character arrays are indexed much like numerical arrays disp(myStringVar(1:5)) % Given that arrays may have variable lengths, we can use the command 'end' to % index the last object in an array. See how we use this to index from end to % start. disp(myStringVar(end:-1:1)); % Cell arays hold the entire string in a single 'cell'. In these cases we can % index the whole cell or also index individual characters within a given cell. % Try the following: disp(myCellArray{1}) disp(myCellArray{1}(1:5)) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % EXERCISE % % Attempt to reference the number 8 in myMatrix using your % own line of code. What row is the 8 located in? What column? Also, try % performing your own mathematical operations on the matrix. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % EXERCISE % % Try to write a statement which 1) Creates a logical array to find all numbers % less than or equal to 2 and greater than or equal to 7 in myMatrix. 2) Creates % a new variable and 3) Stores the values we indexed using our relational and % logical operators to the new variable. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % LESSON 4: PLOTTING % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Octave has a number of built in plot commands. These match up fairly well with % plot types you might be accustomed to in Excel or other plotting software. % Let's start with a basic line plot: x=1:100; y=sin(x); plot(x,y) % For each plot, we can also add some nice cosmetic details: xlabel('X') % X axis label ylabel('Sin(X)') % Y Axis label title('My First Plot'); % A plot title % We can also change the axis limits: xlim([-10,110]); ylim([-2,2]); % If desired, multiple plots can be stored on the same figure. To do this, we % tell Octave to 'hold' the current plot: hold on z=cos(x); plot(x,z,'r') legend('Sine', 'Cosine') % If desired, we can even add a legend to the plot %Notice how the second plot came up in red after we added the 'r' into the plot % function. There are three main changes we can make to the plot command in order % To change the line style (L), the marker type (M) and the color (C). The basic % synatax for this is plot(x,y,'LMC'), where L,M, and C can be any of the % following options: %Line Style: % Solid - % Dashed -- % Dotted : % Dash-dot -. % Marker Type: % plus Sign + % circle o % asterisk * % dot . % triangle(up) ^ % triangle (down) v % triangle(left) < % triangle (right) > % pentagram p % hexagram h % Colors: % red r % green g % blue b % cyan c % yellow y % black k % white w % When combined, we can make any custom combinations: hold off; % stop holding the current plot close all % close any open plots plot(x,y,':hg') % plot the new version of our plot % Some more options grid %turn on a grid for the plot grid off % turn the grid off text(50,0,'. The Middle') % Add text at a specific x and y coordinate gtext('I Put This here!') % use a mouse to place text on your figure % NOTE: These are just a few simple ways in which we can customize a plot. There % are countless more that we will not cover. Use the help documentation to find % additional ways that you can change the plot. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % EXERCISE % % Take a few minutes to play with the plot command. Try creating a set of % Random x and y values and plotting these %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Figures can also be subdivided into many plots of n rows by m columns. In the % example below, we create a 1 row, by 2 column subplot 'Subplot(1,2,x)' and % then designate what we want plotted into the first and second frame of the plot. subplot(1,2,1), plot (x,y) %sine plot subplot(1,2,2),plot (x,z,'r') %cosine plot close all hold off % additional plot types include: % Bar graphs data=rand(1,4) % create random data bar(data) % plot our random data % Histograms data=randn(100000,1); %create random data hist(data,100) %create a histogram with 100 bins % Scatterplots: scatter(x,y) % And many more: % http://www.mathworks.com/help/matlab/creating_plots/figures-plots-and-graphs.html %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % LESSON 5: Scripts and Loops % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %ONE OF THE MOST IMPORTANT THINGS YOU MUST LEARN BEFORE WE LEARN LOOPS: %CTRL + C--- STOPS A RUNNING LOOP (Incorrect code can create infinite loops) % For some programs, you may desire user input. A basic way to do this is to % use the input command. Age=input('How old are you? '); % You can also tell Octave that the answer will be a string by adding 's' to % the second argument of the function: Color=input('What is your favorite color? ','s') % The following types of loops are commonly used in programming: %if %if else %if-elseif %for %while % If statements generally have a conditional expression, a set of commands that % is run if the conditional is met, and and end. Let's look at an example: X=10; if X>=10 disp('hello world') end % Try changing the value of X to various values (true and false) and then % running these lines of code again. % If else statements are similar to if statements, but contain an alternative % set of commands that are processed when the if conditional is NOT met. % Create a new script named 'GuessingGame' and paste the next 6 lines into the % script. Save the script in your current folder. Call the script by typing % "GuessingGame" into the command line and hitting enter. disp('I am thinking of a number between 1 and 10.') A=input('Can you guess which number?'); if A== round((rand()*10)) disp('You Got it') else disp('Nope! try Again') end % As you might imagine from the previous two examples, an If-Elseif loop is % similar to our previous If and If else loops. However, the Elseif command % allows us to include multiple conditional statements: Nums=-10:1:10; Choice=round(rand()*length(Nums)) MyNum=Nums(Choice) if MyNum <0 disp('Dont be Negative') elseif MyNum >0 disp ('Thanks for being positive!') elseif MyNum==0 disp('Way to Zero in on the right number!') else disp ('How did you manage this?') end % For loops are another type of loop that allow us to cycle through multiple % iterations in code: StockProgrammingPhrase='Hello World' % Here we continue to loop 11 times, starting from 1 and ending with the length % of our 'hello world' phrase (11 characters w/ space): for i=1:length(StockProgrammingPhrase) disp(StockProgrammingPhrase(i)) end % Finally, while loops allow us to continue to loop through a code, so long as % the conditions remain true: i=5; while i>0 disp([num2str(i) ' bottles of beer on the wall!']) disp([num2str(i) ' bottles of beer!']) disp('You take one down and pass it around...') i--; % Decrement i; Could also be "i=i-1" % We can nest loops inside of one another. Check out this if loop % inside of our while loop if i==0; disp('No more bottles of beer on the wall') else disp([num2str(i) ' bottles of beer on the wall!']) disp(' '); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % GROUP CHALLENGES % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Break into groups of 4-5. Work together to solve as many of the following % Problems as possible. You may use the code above, google, and one another: % 1) Write a script that asks the user for temperature in farenheight and % Converts it to celcius. % 2) Write a script that returns the slope, given two (x,y) pairs: A=[1 18]; B=[15 3]; % 3) Create a script that simulates rolling a pair of dice, returning two % random numbers between 1 and 6. % 4) Create a loop which rolls the dice 100 times, stores the sum of all rolls % in a variable and then plots a histogram of the sums. % 5) Write a script which allows a user to input the length of three different % sides of a triangle and returns whether or not the triangle is a right triangle. % Hint: Side-Side-Side % 6) Write 'Rick Roll' loop using the following variables and a while loop: A={'Never Gonna'}; B={'Give you up', 'Let you down','run around and desert you',... 'make you cry','say goodbye','tell a lie and hurt you'} % Hint: If you don't know what Rick Rolling is, remember that you are allowed to % Use Google. Try Youtube first. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % CONGRATS, YOU HAVE SURVIVED BOOT CAMP! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Want more practice? Your data is a good start, but also: % http://www.mathworks.com/matlabcentral/cody/problems % https://projecteuler.net/ % https://adriann.github.io/programming_problems.html