Here is the M-File for the Walsh Approximation. Right click on the link and go to save target as. Save the file to the desktop and open it from Matlab. We have been executing functions in the command window, it is much more efficient to create and M-File. To create an M-File, click file, new, M-File. The file can be easily modified and then executed by pressing F5 or opening the Debug heading and clicking on Save and Run. Every time you run the file all of the entries are carried out in the command window. After you have the walsh.m file open, run it and two plots will appear. One plot will be of the sine wave and the other the approximation.
Go back into the M-File and change the range of n in the line for n =
Return to Matlab Tutorial.