Creating 2d grid from cell array of data points
13 次查看(过去 30 天)
显示 更早的评论
Hi All, I am trying to create a 2-d grid of x and y locations for certain data points I have organized in a cell array. Each component of the cell array is an ordered pair. I want to plot each ordered pair on a grid, but I am very very new to matlab and haven't had much luck looking through the "Help" or internet searches. Literally I think this should just be some sort of scatter plot, but the command does not seed to work on my end. I feel as though this must be very easy to do. Any suggestions?
Thanks, Garrett
0 个评论
采纳的回答
Andrew Newell
2011-7-19
If your cell array is c, you could use
x = cell2mat(c(:));
plot(x(:,1),x(:,2),'.')
The colon operator in c(:) makes c into a column vector, so x is a matrix with 2 columns.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!