How to plot/use numerous values in single cell?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Brian Tomblin
le 8 Juin 2016
Réponse apportée : Kirby Fears
le 8 Juin 2016
I am incredibly new to Matlab, so any help would be appreciated!
I am given data in three rows of 8000 cells each with each cell having between 1 and 40 individual values. I need to plot these values on a scatter plot (each cell has either solely X, Y, or Z values that work with the corresponding values of the other rows to outline an object). So, how can I take the values inside each cell and make them individual/ungrouped values that can then be evaluated/plotted? If more information is needed, I'd be happy to elaborate. Thank you.
0 commentaires
Réponse acceptée
Kirby Fears
le 8 Juin 2016
Brian,
This example should be a good starting point.
% Setting up some test data
x = rand(40,3);
data = cell(3,8000);
data(1,1) = {x(:,1)};
data(2,1) = {x(:,2)};
data(3,1) = {x(:,3)};
% Plotting first column of data cell in 3D scatter
scatter3(data{1,1},data{2,1},data{3,1});
Use curly brackets to unpack a double array from a cell. Check out the documentation for scatter3() .
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Scatter Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!