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

采纳的回答

Andrew Newell
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 CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by