How to load a file in a function
Mostrar comentarios más antiguos
Hello,
I've recently started learning MATLAB, so forgive me if my question and code are both ridiculously stupid.
I'm attempting to write a function that, amongst other things, loads a file from the currently directory into the workspace in order to use the data in this file for other parts of the function.
Currently, the code looks like this:
function [] = tubeguide ()
load ('hamm_and_city');
end
'tubeguide' is the function name, and 'hamm_and_city' is the file I'm attempting to load, but currently, nothing loads into the workspace.
Thanks.
Respuesta aceptada
Más respuestas (1)
Categorías
Más información sobre Workspace Variables and MAT Files en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!