To use "mkpp" with a matrix of 256 coefficients, you need to define a corresponding set of breakpoints. The number of breakpoints should be one more than the number of polynomial pieces you want to create. If you have 256 coefficients and you want to create a piecewise polynomial where each piece corresponds to a single coefficient, you'll need 257 breakpoints.
Below are the steps to define breakpoints:
- Since "mkpp" expects the number of pieces to be one less than the number of breakpoints, and you have 256 coefficients, you should create 257 breakpoints.
- Assume you want each coefficient to apply over a uniform interval, you can define breakpoints as a simple linear space.
Sample code for the same is given below:
X = imread('cameraman.tif');
breaks = linspace(0, 256, 257);
coeffs = [Xn(:), zeros(numel(Xn), 1)];
For better understanding of breakpoints in "mkpp" refer to the follwoing documentation:
Hope that helps!