# How to plot/use numerous values in single cell?

4 ビュー (過去 30 日間)
Brian Tomblin 2016 年 6 月 8 日

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.

サインインしてコメントする。

### 採用された回答

Kirby Fears 2016 年 6 月 8 日
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() .

サインインしてコメントする。

### Community Treasure Hunt

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

Start Hunting!

Translated by