How to pass .mat contents to be used in m-file?

2 views (last 30 days)
Hiya,
I managed to save the data that is entered in GUI in .mat file. Separately, I wrote an m-file (not function) that performs some calculations based on some declared variables (e.g. x = 0.1, y = 20, etc.) at the beginning of this m-file, and then shows the results in figures.
My question is: how can I pass these data that are entered in the GUI then saved in .mat file to be used in the m-file instead of the manually declared variables (i.e. pass the values of x, y, etc. and then perform the calculations and plot the the results)? Also, are there any changes required to the m-file (make it a function or functions)?
Many thanks

Answers (0)

Community Treasure Hunt

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

Start Hunting!