How to generate a 4 D plot.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dear Friends,
We have four variables: ,,, with conditions ,. We want to plot this function
with assumption that .
How can we generate the plot for F?
2 Kommentare
Walter Roberson
am 27 Jul. 2019
You have 4 independent values and 1 dependent value, so your plot would have to be 5 dimensional. Did you have some ideas on how you wanted to encode the 5 different dimensions ?
Antworten (2)
Walter Roberson
am 27 Jul. 2019
vals = 0 : 0.01 : 1;
[p1, p2] = ndgrid(vals);
mask = p1 + p2 <= 1;
p1 = p1(mask);
p2 = p2(mask);
[idx1, idx2] = ndgrid(1:length(p1));
V = @(M) M(:);
x = V(p1(idx1));
y = V(p2(idx1));
u = V(p1(idx2));
v = V(p2(idx2));
Now x, y, u, v are each column vectors, and for any given index, x(K), y(K), u(K), v(K) is such that x(K)+y(K)<=1 and u(K)+v(K)<=1 . This gives you 26532801 (over 26 million) points.
You can now evaluate F in vectorized form. You can then do corrections for the cases where x and u are both 0 or y and v are both 0 or 1-x-y is 0 together with 2 - x - u - u - v being 0.
This will leave you with 26532801 x, y, u, v, F coordinate tuples.
With the data all calculated, you now have to decide what a 5 dimension plot should look like. Did you have some ideas on how you want to represent 5 dimensional data on a 2 dimensional display ?
4 Kommentare
John D'Errico
am 27 Jul. 2019
You want to plot some function of 4 variables. So essentially, you have a 5-dimensional plot you want to see. Not gonna happen. Your monitor is TWO dimensional. We plot 3-d plots as needed, because your brain understands how to visualize a 3-d thing from a 2-d scene. You rotate it around, etc, then gaining an understanding of the object.
But you have 5 dimensions of interest. Not 2 or 3. Not even 4 (where there is one trick you can do with an iso-surface, sort of a contour plot in 3-d.) You can also play with Chernoff faces, but I have never personally found them to be of much value.
So unless you have bought one of those new holodeck monitors, available from Starfleet Command for a princely sum of federation credits (surely you can guess what it costs to ship stuff from the other side of the galaxy) you cannot visualize 5-dimensional stuff on a 2-d monitor.
I'm sorry, but we all live in sphereland. (Read the book! At least, start with Flatland, truly a fun book to read.) 5-dimensions is out of view for us common 3-d people, who can see only 3 dimensions.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!