can i change how load function operates?

2 Ansichten (letzte 30 Tage)
Micke Malmström
Micke Malmström am 31 Jul. 2025
Bearbeitet: Matt J am 31 Jul. 2025
the operation of the "open" function can be modified by writing specific "openXXX" functions (where XXX is the file-extention). But I would like to do some operations after a .mat file is opened/loaded based on what variables are stored. So if the .mat file contains only a variable called "measuredData" then I would like to run some code post loading it into workspace... is it possible?
I want to run the following snippet, but where can i place it so that is is run everytime a -mat file is loaded or Drag n' Droped in the command window.
variableInfo=who('-file',filename)
if ismember(variableInfo,'measuredData')
%run some code on "measuredData"
end

Antworten (1)

Matt J
Matt J am 31 Jul. 2025
Bearbeitet: Matt J am 31 Jul. 2025
You cannot, unfortunately.

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by