Saving the output from a function
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dustin Snedeger
el 6 de Sept. de 2020
Respondida: Image Analyst
el 6 de Sept. de 2020
Is there a way to save an output from a function for later use, For example if the function outputs an array can I call the function from another file and use the outputted array for calcuations after the fact. If there is away can you showcase how to do it thanks in advance just trying to learn!
0 comentarios
Respuesta aceptada
Image Analyst
el 6 de Sept. de 2020
Of course. Read up on functions. Here is an example
m = rand(50);
theMax = max(m(:)) % Call the max() function for example.
% Save the result to 'answers.mat' file:
save('answers.mat', 'theMax');
Of you can use fprintf() or writematrix() or any number of other functions to save/export the variables you want.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Large Files and Big Data en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!