Hello everyone, I am facing one problem,
Show older comments
I have 3 different non linear data. Let's say x,y and z.for different values of Z I have different data set of x and y. If I fix the value of Z I am able to find the relation between x and y, but if I change the value of Z that relation won't work, I need to find relation between x,y and z independently. Can anyone please help! Thank you in advance.
for z=500 I have x = 1145 to 1240 with the gap of 1,y = (17.75,16.2,15.1,14.25,13.45.... respectively
for z=400, x values remains the same 1145-1240 y values differs.
I need to find a relation between x,y and z independently. in which y = fun(x,z). thank you.
Accepted Answer
More Answers (1)
Image Analyst
on 30 Nov 2018
For each z, get or compute the x and y arrays. Then fit a model for y using the x array, and the scalar value of z for those arrays. In pseudocode:
z = [......] % Some list of z values
for k = 1 : length(z)
thisZ = z(k);
xVector = ...% Whatever you need to do to get the x vector for this z
yVector = ....% Whatever you need to do to get the y vector for this z
% Now find some model passing in the xVector and yVector and this z value.
yourModel = FitModel(xVector, yVector, thisZ);
% Now do something with the model, like apply it, save it, plot it, or whatever.....
end
I have no idea what the model for each pair of x and y vectors might be. Would they all be the same, like fitting a line or parabola? Would they be different, like some might be a line and others might need an exponential decay? Would it be empirical so you don't have model parameters, but just a smoothed/fitted y vector as output, like as if you applied smooth() or sgolayfilt() to the raw data? We have no idea since you didn't share that information with us.
3 Comments
Aakash Nanda
on 1 Dec 2018
Image Analyst
on 1 Dec 2018
Edited: Image Analyst
on 1 Dec 2018
Why do the first two have only 4 points, and the others have 5 or 6 points? Why aren't they all the same size?
Attached is what I have so far.

I didn't go further because I don't think you have enough points in there to do meaninful fits. Attach more data.
Aakash Nanda
on 1 Dec 2018
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!