Attempt to Plot a Coloured Surface to Visualize 4D data.
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello, I'm attempting to visualize some 4D data in order to understand the toplogy of an optimization problem that I've been set.
I currently have a large matrix, that is size 3600x4. The first 3 values are randomly generated "gains" for a control system, and the last is the "fitness" of the gains determined by running the gains through a dynamic simulation and determining how close those gains get us to a prescribed demand.
Now what I want is to plot out a surface that covers the three gains say [K1, K2, K3] = data(:,1:3); and determine their colour based on the value of the fitness F, with say, F = 0 being red, and F = 1 being green (F is between 0 and 1 not inclusive.)
The code below generates a nearly identical data set.
x = 20*rand(3600,1);
y = 20*rand(3600,1);
z = 20*rand(3600,1);
F = rand(3600,1);
data = [x,y,z,F];
Where for my own eyes I usually follow this with a
topologydata = sortrows(data,size(data,2));
So that I can see if the best fitness is within reasonable bounds. However, you can leave it unsorted if the method that you use prefers or doesn't need it. Realistically, if I can get the plot out the way I'm visualizing it, then I won't need to sort it.
댓글 수: 2
채택된 답변
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!