MATLAB: How to extract value from a Cell array to text file or CSV file

cell arraysdigital image processingdigital signal pro...digital signal processinggraphimage processingMATLABpointsignal processing

I have a figure with some exact(detected) point. See the figure.
I want to find the X-Level value and Y-Level value of the detected points. I found the code on this website. It works also good. The code is given below:
ax = gca;
obj_with_xd = findobj(ax, '-property', 'XData');
obj_with_right_markers = findobj(obj_with_xd, 'Marker', 'v', '-or', 'Marker', 'o', '-or', 'Marker', 's');
the_xd_cell = get(obj_with_right_markers', 'XData');
if ~iscell(the_xd_cell); the_xd_cell = {the_xd_cell}; end
the_yd_cell = get(obj_with_right_markers, 'YData');
if ~iscell(the_yd_cell); the_yd_cell = {the_yd_cell}; end
From this code, I want to extract the the_xd_cell and the_yd_cell Cell Array value in a text file or CSV file in that way like such that, R1: X-level: 42, Y-level: 0.908 again R2: X-level: 137, Y-level: 0.854 and so on for all detected point of RQS (Q1, Q2…).. How can I do that?
I also attached 2 screenshots for your easiness. The the_xd_cell cell is given below:
Some value of the_xd_cell is given below:
Help to solve this problem.

Best Answer

EDITED
the_xd_cell=load('the_xd_cell.mat')
the_xd_cell1(1,:)=the_xd_cell.the_xd_cell{1}
the_xd_cell2(1,:)=the_xd_cell.the_xd_cell{2}
the_xd_cell3(1,:)=the_xd_cell.the_xd_cell{3}
dlmwrite('sample.txt',the_xd_cell1,'delimiter',' ')
dlmwrite('sample.txt',the_xd_cell2,'delimiter',' ','-append')
dlmwrite('sample.txt',the_xd_cell3,'delimiter',' ','-append')