matrix of data into a formula
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have a data that is 5D matrix of Y(x,n,s,z).
I wonder if there is a function or code that could extract a relation like:
Y=ax+bn+cs+dz;
with some degree of freedom/error maybe.
Thanks in advance.
0 comentarios
Respuestas (1)
Walter Roberson
el 24 de Abr. de 2023
This is to filt Y = ax + bn + cs + dz + constant
xvec = list of valid x values, in the order used to construct Y
nvec = list of valid n values, in the order used to construct Y
svec = list of valid s values, in the order used to construct Y
zvec = list of valid z values, in the order used to construct Y
[Xg, Ng, Sg, Zg] = ndgrid(xvec, nvec, svec, zvec);
A = [Xg(:), Ng(:), Sg(:), Zg(:), ones(numel(Xg),1)];
b = Y(:);
xnsz1 = A\b;
a = xnsz1(1); b = xnsz1(2); c = xnsz1(3); d = xnsz1(4); constant = xnsz1(5);
0 comentarios
Ver también
Categorías
Más información sobre Linear Regression en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!