plot an eight variable function
Mostrar comentarios más antiguos
Hi everyone
I have an equation with 8 variables. I know how to plot a 3-variable equation in Matlab, but I need to plot this function with eight variables.
y= (5)*x(1)^2-(200)*x(1)+...
(0.3)*x(2)^2-(150)*x(2)+...
(0.4)*x(3)^2- (50)*x(3)+...
(2)*x(4)^2 - (82)*x(4)+...
(3)*x(5)^2 -(250)*x(5)+...
(5)*x(6)^2 - (23)*x(6)+...
(4)*x(7)^2 -(201)*x(7)+...
(12)*x(8)^2-(300)*x(8);
I really appreciate any help.
3 comentarios
dpb
el 26 de Ag. de 2022
No real way to do that in one go; there's a set of partial-variable diagnostic plots in the curve-fitting toolbox that can help, perhaps, but other than that not sure can do anything other than pick the combinations of sets of variables at a time.
Of course, unless this is defined by an a priori model with known, fixed coefficients, the first thing to do with a model would be to test for and reduce the complexity by any for which coefficients are not significant. That may not be fruitful in this case as all are apparently of such magnitude as to be significant depending upon the range of the various x variables.
That aside, the above is NOT a valid MATLAB expression; what is the functional form combining the terms shown? As is, this is interpreted by the MATLAB parsing engine as if it were
y= (5)*x(1)^2-(200)*x(1)(0.3)*x(2)^2-(150)*x(2)(0.4)*x(3)^2- (50)*x(3)...(12)*x(8)^2-(300)*x(8);
which is not a parseable expression.
BTW, as a coding style/MATLAB syntax observation, it is not necessary to use the parentheses surrounding the coefficients; one can just as easily write 5*x(1).
Walter Roberson
el 26 de Ag. de 2022
Are those terms being summed? If so then each of the lines describes a parabola in one dimension, and they are all independent.
shirin mhd
el 27 de Ag. de 2022
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Orange en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!