How to load a file in a function
Show older comments
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.
Accepted Answer
More Answers (1)
Categories
Find more on Workspace Variables and MAT Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!