function [ a0,am,bm ] = test( numTerms ) b_m = zeros(1,numTerms); ... Looks to me that your problem is what sawtooth returns the mathworks ...
stackoverflow.com