How to plot/use numerous values in single cell?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
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() .
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!