I want to create a function function ExtremePoints = AnalyseData( ScanData ).
I want to be able to run the function without passing the argument ScanData, and in this situation I want to use a variable with the same name from Matlab Workspace.
Is this possible, to use inside the body of the function the variable ScanData which appear in workspace?
Or should I first save the content of the variable ScanData from workspace into a .mat file and then load that file in the body of the function?
ScanData, less clear code, mlint will not warn you for your mistakes insideevalorevalin, ...). So do yourself a favor and refrain from using these when you don't have to!function ...). All variables will then be part of your base workspace. So this might become cluttered and you might need to play around with things likeclear variables; close all; clc;for convenience. Or you could use the run configurations feature. However, these are cumbersome to keep track of in version control or on different computers. So both have pros and cons.