Borrar filtros
Borrar filtros

Saving data using save as function

1 visualización (últimos 30 días)
Rohit Bhoi
Rohit Bhoi el 10 de Nov. de 2015
Respondida: Walter Roberson el 10 de Nov. de 2015
I havae one DAQ GUI in which I am taking some reading and saving in one file using dlmwrite() function, but each and every time data get over-right in same file and I want separate file each time, So how can I provide a separate push button as saveas? how to use save as() function.. please do me help

Respuestas (1)

Walter Roberson
Walter Roberson el 10 de Nov. de 2015
For example:
for K = 1 : 15
filename = sprintf('Output_%02d.jpg', K);
surf( rand(5,5) ); %some plot
drawnow();
saveas(gca, filename)
end
That is, you can compute the filename that you pass to saveas(). In the above example, %02d means to output as an integer of at least two digits using leading 0's if needed to make two digits -- so 01 then 02 then 03 ... 09 then 10 then 11 and so on.

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by