Info

This question is closed. Reopen it to edit or answer.

How to pass several vectors to a custom fit function

1 view (last 30 days)
Fabian
Fabian on 22 May 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
Hello everyone,
I am having serious trouble getting my fit to work (worked like a charm with fminsearch but now I need confidence bounds, so I have to use fit)
My problem is that I need to pass several vectors or matrices to my fit function which is defined in a seperate .m file.
Basically it would look like this:
f=fittype('TR3PPE(x-axis,another x-axis,y-axis needed for calculations,w'),'independent',{'x-axis','another x-axis','y-axis needed for calculations'},'coefficients',{'w'} );
where TR3PPE.m is function [Signal]=TR3PPE(x-axis,another x-axis, y-axis needed for calculations, w)
x-axis is a 78x1 double
another x-axis is a 22,000x1 double
y-axis needed for calculations is a 22,000x1 double
Starting point for w is 100, minimum is 50, maximum is inf.
Now when I start the script, the fit is called with
x-axis 7x1 double
another x-axis 7x1 double
y-axis needed for calculation 7x1 double
w = 0.5
I am completely confused and have no clue as to what I can do about this.
Thanks for any advice you can give me on this

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!