You can do what you want by
S = [ans{:}];
x = [S.x];
y = [S.y];
plot(x,y)
The first line converts the cell array into a struct array. ans{:} returns a comma-separated list of all elements in the cell array. The square brackets capture that, catenating all elements into a vector.
S.x again returns a comma-separated list. Here we catenate all x values into a numeric vector.
Unsolicited advice
But please, please, please change how you store your data. Below I'll make a case for why you should.
Let's start with some random data in a structure similar to yours (a cell array where each element is a struct):
C = cell(1,100);
for ii=1:length(C)
C{ii} = struct('x',randn(1),'y',randn(1),'z',randn(1),...
'name',char('a'+floor(rand(1,10)*('z'-'a'+1))),...
'status',rand(1)>0.3);
end
A better solution is a struct array:
S = [C{:}];
A struct array is a standard thing in MATLAB: it's an array where each element is an identical struct. You index these two somewhat differently:
>> C{5}
ans =
struct with fields:
x: -0.0818
y: 0.5463
z: -0.8194
name: 'ysrkqlzcms'
status: 1
>> S(5)
ans =
struct with fields:
x: -0.0818
y: 0.5463
z: -0.8194
name: 'ysrkqlzcms'
status: 1
Why is S a better solution than C?
A struct array is much more efficient memory wise
>> whos
Name Size Bytes Class Attributes
C 1x100 103700 cell
S 1x100 60820 struct
Note how C occupies almost double what S does. Why is this? C contains 100 structs, each struct stores some values, but also the names of those values. Thus, C stores 100 times the same names (in this case, 'x', 'y', 'z', 'name' and 'status'). S only stores those once.
A struct array is much easier to index.
That you needed to post this question proves this point. The first step in my answer was to convert the cell array to a struct array. Luis Mendo's answer shows how awkward it is to work with a cell array of structs.
A struct array is safer
You can do C{5} = 'sorry', and prevent any sort of approach to use all x elements of the structs, because one of the cells no longer is a struct. S(5)='sorry' gives an error. This is to say, there is no way to enforce that all structs in your cell array of structs have the same elements. This complicates things significantly.
But there's an even better approach
Since MATLAB R2013b there is a table class. Objects of type table are even better than struct arrays.
T = struct2table(S);
A table stores each column as a single array, and therefore has a lot less overhead. That is, T.x is a single array, rather than S.x which is 100 arrays. This makes it much, much more efficient:
>> whos
Name Size Bytes Class Attributes
C 1x100 103700 cell
S 1x100 60820 struct
T 100x5 17476 table
Note how T uses 1/6 of the memory of C. This makes it also type safe: the x value for each row is guaranteed to be the same type and size. You cannot assign a string to one x value, nor anything that is not a scalar, if x is defined as a scalar double.
Indexing again is slightly different, but T.x directly gives you the array for all x values, and
>> T(5,:)
ans =
1×5 table
x y z name status
_________ _______ ________ ____________ ______
-0.081774 0.54633 -0.81939 'ysrkqlzcms' true
So instead of indexing C{5}.x or S(5).x, you do T.x(5).