plot an eight variable function

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 Comments

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).
Are those terms being summed? If so then each of the lines describes a parabola in one dimension, and they are all independent.
yeah, that was my fault, thank for your attention.

Sign in to comment.

 Accepted Answer

John D'Errico
John D'Errico on 26 Aug 2022
Edited: John D'Errico on 26 Aug 2022
It is easy, even trivial to do. All you need is one of those nice hyper-dimensional monitors. They are difficult to buy though, as you can only obtain them from Starfleet Command, and shipping is always really slow from the future. It might take centuries to get one, in fact. I do hear that the Borg will deliver though, but do you really want the Borg to show up on your doorstep? (Well, maybe if it was Jeri Ryan ... No, Not even then.)
Seriously, you can't do it. What is a plot? A plot is a TWO dimensional thing, viewed on your monitor. Yes, you can see three dimensional stuff, but even then, you really need to rotate the view around to understand it as a 3-d thing. A picture is just a projection of that thing, rendered into only TWO dimensions. Otherwise, without the cues to understand what the thing is in 3-d, your brain cannot percieve what it sees. So without the extra visual cues, you end up with the same confusions as if you were looking at an MC Escher print.
But now, how do you intend to view that 8-dimensional monster? Again, we will assume your hyper-dimensional monitor is out of stock, or perhaps just forward-ordered. Perhspa you can look at a picture of a 4 or 6 dimensional hypercube, and understand what you are looking at. If you can, then you are smarter than 99.999% of all people.
Remember your brain understands 3-d. With some help, it can handle a 2-d image, and recognize what it sees as 3-d. With some extra mechanisms, like 3-d glasses, so each eye can now get a subtly different image, you can even "see" in 3-d then. But that is the limit.
Your brain is just not built to handle 8-d.

1 Comment

Thank you very much for your very detailed explanation.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!