Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not reading the data. #2

Open
ranabanik opened this issue Jun 12, 2023 · 1 comment
Open

not reading the data. #2

ranabanik opened this issue Jun 12, 2023 · 1 comment

Comments

@ranabanik
Copy link

running the code as following to fit 5 Lorentzian peaks.

xdata = pixelPeakData{p,1}';
ydata = pixelPeakData{p,2}';
% Fit = PeakFit();
Fit = PeakFit([xdata; ydata], ...
                'Window', [-5, 5], ...
                'NumPeaks', 5, ...
                'PeakShape', 1, ... % 'Lorentzian'
                'CenterStart', [-3.5, -1.6, 0, 2, 3.5], ...
                'CenterLow', [-4, -1.7, -1, 1, 3.4], ...
                'CenterUp', [-3, -1.5, 1, 2, 3.6], ...
                'BaselinePolyOrder', 1 ...
                );

But it gives the followoing error.

Error in PeakFit (line 314)
            if k <= N && isrealmatrix(varargin{k})
Error in peakfitting_toil (line 8)
Fit = PeakFit([xdata; ydata], ... 

xdata, ydata both are 1x30 double

@heriantolim
Copy link
Owner

Thank you for posting the issue. Try the second syntax: obj = PeakFit(XData, YData, ... Name-Value ...). Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants