i don't know how to use lsqcurvefit in this case

조회 수: 1 (최근 30일)
Meddour Aissam riad
Meddour Aissam riad 2020년 2월 20일
Hi everyone,
so these is my problem:
let suppose i have this equation Y=P*(a*x+b)
i have a data vector for x let's say x=[1 2 3 4 5 6 7 8 9] , and the initial value of P let'sz say P=5, and i need to find the the value of a and b that minimise the squared error between my function and another vector (Not an Y vector) with the function LSQCURVEFIT.
this is how my algorithm should work, my LSQCURVEFIT should give me a value for 'a' and 'b' and with those value i have to calculate the ydata for all the value of 'x'
i'll take the last value of Y and i should stock it in a new vector let's name it 'ANA'. the last value of my ydata will replace the value of my 'P' and then i should do the same calucation for 20 times for exemple (so we will use a for loop)
so in final i have to compare the value of thisvector (20 number) with an experminetal data that have also 20 number
how should i procceed , if you need more explanation i'm here

답변 (0개)

카테고리

Help CenterFile Exchange에서 Downloads에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by