File Exchange

image thumbnail

Fourfun

version 1.1.0.0 (19.2 KB) by Kristyn McLeod
A system for automatic computations using Fourier expansions

0 Downloads

Updated 24 Jun 2014

View License

This is a collection of functions named Fourfun that uses object-oriented programming in MATLAB. It can be used to quickly and accurately approximate periodic functions with Fourier expansions. To increase efficiency and reduce the number of computations of the Fourier transform, Fourfun automatically determines the number of nodes necessary for representations that are accurate to close to machine precision. Common MATLAB functions have been overloaded to keep the syntax of the Fourfun class as consistent as possible with the general MATLAB syntax.

To get started, one must make a fourfun object. Fourfun objects can then be manipulated using the following functions: cos, diff, exp, int, integral, log, plot, roots, sin. See the comments for the required arguments for each function.

Here is a quick and simple example of how to make a fourfun object (a fourfun object is the approximation of a periodic function), find the roots of the fourfun, and then plot the results.

f=fourfun(@(x) cos(3*x));
g=roots(f);

hold on
plot(f,'r')
plot(g,zeros(1,length(g)),'.k')
hold off

Comments and Ratings (2)

aissa mohamed

nice work kRISTYN mcleod

GREGORY

[b,alpha,Ynew,cl] = multiclass(Xtrain(:,2:4),TEST2(:,5),'linear',1,1,'multiclasslog.txt')
??? Undefined function or method 'multiclass' for input arguments of type 'double'.

Can anybody helps me ?

Updates

1.1.0.0

I have added a brief explanation of how to get started using Fourfun.

MATLAB Release Compatibility
Created with R2013b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor

Fourfun/@fourfun/