My axes contains more than one line object and I want to write the data from that axes containing the line objects into an ASCII text file. For example:
clcclearx = 1:10;y1 = x;y2 = sin(x);y3 = cos(x);plot(x,y1,...x,y2,...x,y3);% clearing all existing varibles
clcclear% get handle to current axis
line_handle=findall(gca,'Type','line');x=get(line_handle,'XData');y=get(line_handle,'YData');% saving file in ASCII text
save mydata.txt x y -ascii
When I execute the above code I get the following error:
%%%BEGIN WARNING MESSAGE%%%
Warning: Attempt to write an unsupported data type to an ASCII file.
Variable 'x' not written to file.
Warning: Attempt to write an unsupported data type to an ASCII file.
Variable 'y' not written to file.
%%%END WARNING MESSAGE %%%
Best Answer