Hi
I had the same problem and it comes from the "save" step.
First, when you use "save" you have to save in a .mat file. Than , when you correctly save your pattern , I had an error message and when i opened the script of the wavemngr function and execute step by step it stopped when an other function was called because of the name of the variables that i registered in my .mat file, so I had to call xval and psi X and Y and after having changed their names my code worked.
Here is the code I suggest you, you can try and comment me if it corked fine, that the code i used.
% Create the pattern signal t = linspace(0, 1, 1024); y = (1./(1+(4*(t-0.5)).^4)).*cos(20*(t-0.5));
% Create a polynomial fit of the pattern signal [Y,X,nc] = pat2cwav(y, 'polynomial', 10, 'continuous') ;
% Plot the pattern compared to the polynomial fit plot(t,y,'-',tval,nc*Y,'--'), title('Original Pattern and Adapted Wavelet (dashed line)') save('mother.mat', 'Y', 'X');
% you dont need the nc value to be save as by convention all wavelets saved are of energy = 1 (the integral =1) and this variable is not used in cwt or wavemngr, it is only useful to pass from your pattern to the adapted pattern
wavemngr('del','CosWave');
wavemngr('add','CosWave','cosw',4,'','mother.mat');