Fit a sum of basis functions to an array
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Anshuman Borgohain
el 23 de Jun. de 2018
Comentada: Anshuman Borgohain
el 28 de Jun. de 2018
Can someone give me an idea how do I fit a sum of basis functions to an array? The context is image analysis and I am trying to find a convolution kernel from one image to the other. I am able to form the basis set, but unable to move forward from there on. P.S. I am very new to MATLAB.
0 comentarios
Respuestas (1)
Kim Winter
el 27 de Jun. de 2018
Hi, I have included an example below that might be pretty different than yours, but you can put your own values in. Below, I first create a function handle, with an array of my functions(in this case, sin(x) and cos(x)^2). I then create a series of inputs, x, using linspace. This creates 1000 equally spaced points between 1 and 1000. I then run my inputs through. Finally, I add my answers together.
%define basis functions using function handles
basis_funcs=@(x)sin(x);
basis_funcs2= @(x)(cos(x).^2);
%evenly spaced input array
inputs=linspace(1,1000,1000);
%input arrays into functions
output=basis_funcs(inputs);
output2=basis_funcs2(inputs);
%add outputs
outputfin=output+output2;
Hopefully this is what you're looking for!
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!