Clear Filters
Clear Filters

how to send the polyfit with different dimension of X and Y ?

2 views (last 30 days)
HELLO,
I am xTrain as cell array with [1 , 8614] and yTrain also Cell array[ 1, 4612]
Converting these to arrays with
X_poly = cell2mat(xTrain);
y_poly = cell2mat(yTrain);
passing these parameters to polyfit function
[X_polynominal, mu, info]=polyfit(X_poly,y_poly,p);
Getting an error of
X and Y vectors must be the same size.
please help in how to resolve these issue or my question is we cannot pass the different dimesnion of X and Y to polyfit?
Thanks for the answers
Geetha.S
  3 Comments
Geetha shastry
Geetha shastry on 27 May 2020
hi ,
thanks for the immediate reply
actually am using Xtrain
like this
xTrain = con2seq([...
(3v3Red(idxStart:end)');
(Bldc1_I1(idxStart:end)');
(Bldc1_I2(idxStart:end)');
(Data_0__Speed(idxStart:end)');
]);
yTrain = con2seq([...
Oil_Flow(idxStart:end)')
]);
and p = 2;
then , is there any other way we can pass these different arrays
Thank you
KSSV
KSSV on 27 May 2020
Check the dimensions of x, y ..they should be equal.

Sign in to comment.

Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Tags

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!