How to create a plotmatrix from a cell?

3 Ansichten (letzte 30 Tage)
toka55 am 11 Dez. 2020
Kommentiert: toka55 am 15 Dez. 2020
I have two cell arrays (one for x values and one for y values), each containing 64 x 1 matrices with unequal dimensions. The respective x and y values belong together. I want to create an 8x8 scatterplot matrix. Can I use plotmatrix for this purpose or are there other solutions?
0 Kommentare-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Sindar am 15 Dez. 2020
A scatterplot matrix is for if you have several equally-sized columns that you want to plot against one another. That doesn't sound like your problem. It sounds like you have 64 sets of data that you want to plot separately.
Does this do it:
% number of cells
N = 4;
% generate test data
for ind=1:N
X{ind} = rand(randi(10),randi(10));
Y{ind} = rand(size(X{ind}));
end
% create a (here) 2x2 subplot arrangement
tiledlayout(sqrt(N),sqrt(N))
for ind=1:N
% in a particular subplot
nexttile
% scatter plot all Y points vs X points
scatter(X{ind}(:),Y{ind}(:))
end
(if you have 64 sets of data, where you want to create a scatterplot matrix for each set... may I recommend a separate figure for each plot so you can actually see anything?)
1 KommentarKeine anzeigenKeine ausblenden
toka55 am 15 Dez. 2020
Thanks exactly what I need.

Melden Sie sich an, um zu kommentieren.

Kategorien

Find more on Discrete Data Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by