フィルターのクリア

Creating a general plotter for arbitrary data table matlab gui

10 ビュー (過去 30 日間)
Thomas Dixon
Thomas Dixon 2021 年 1 月 20 日
I would like to make 2D plots from multi-variable data taken from an expreiment. The experiment has n-parameters and measures m things at these parameters. Meaning every time it takes a measurement there are m+n things to record. I then produce a table of these things and load them into my GUI, which displays the table nicely and i can rename columns dynamically etc, all very nice.
What I now want to be able to do is select a column and assign it as the x-axis, select another column and assign it as the y-axis, and then select from the remaining data variables the be held constant in the plot and variables to group in the plot.
A MWE example of my data might be:
a=1:1:10;
b=35:1:50;
c=[-1,0,1];
m=1;
for i=1:length(a)
for j=1:length(b)
for k=1:length(c)
dat(m,1)=a(i);
dat(m,2)=b(j);
dat(m,3)=c(k);
dat(m,4)=a(i)+b(j)+c(k);
dat(m,5)=a(i)-b(j)+c(k);
dat(m,6)=a(i)+b(j)-c(k);
dat(m,7)=a(i)-b(j)-c(k);
m=m+1;
end
end
end
I then want to create a UITable which displays this data (Done)
Be able to name the column headers dynamically (Done)
Define a drop down menu for x and y columns (Done)
Then by selecting cells on the UItable (CellSelection callback) I would like to:
  • Be able to click a cell, get the value of that cell, create a list of all of the indices of the table which have this value, then continue this over multiple cells (ie holding some values constant) and plot the raw data with markers (as it will be unsorted). Lets say I click on a cell where b=35, and c=-1, c=0, and c=1. So only rows of data where these are what I want to plot for my specified x's and y's.
  • Then once plotted I would like to be able to group some values, so say I choose to plot a against the sum of a,b,c. but only for values of b=35 but all values of c. ie there is loadsa of points but 1/3 of them are for c=-1, c=0 or c=1. I then group together all of them based on this fact. Perhaps this is with some other table or something. But essentially the first line plot will be for a=1:1:10, b=35, c=-1 then a+b+c=35:1:44 so I would plot([1:1:10],[35:1:44]) then plot([1:1:10],[36:1:45]) then plot([1:1:10],[37:1:46])
The point is I want to be able to get the value from the cell that I select, then search through the column getting all the indices of places where this/these values appear. Then once plotted i want to look at the data and group together 'like' data in some way without any prior information of how many variables are swept over or how many measurements are taken at each step in the sweep. The final data is rectangular though.
I have become stuck with this, my thoughts are perhps to creat a subtable for point 1 which has the data being plotted (ie somehow gets the data from the index of all the values of the large data, and then plots it out). Then I add a further callback function where I can select a column from this table and seperae it into its unique values, for each unique value I then find the indices where it appears in the subset and group this into one line and sort it along the x-axis (so I can make a line plot from it)
I understand this is quite rambly, any advice on posing this question in a more coherent way is also welcome.
Tom

回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by