I have 2 .m files, for an example say "project_main.m" and "my_function.m"
When I run the program in Octave it works fine. However the only variables I can see in the workspace area are those created in project_main.m, I would like to examine variables created in my_function.m from the workspace area.
Example:
project_main.m:
close all;
clear all;
clc;
X = 1;
Y = 2;
%---call function in external .m file---
my_function(X, Y);
my_function.m:
function functionResults = my_function(iX, iY)
fprintf("X = %d, Y = %d\n", iX, iY);
Z = iX*iY;
fprintf("Z = %d\n", Z);
end
This will give me on the command window:
X = 1, Y = 2
Z = 2
>>
As expected. However in the workspace area I only see X and Y, not Z:
I know I can see Z on the command window, but how do I examine variables created in separate .m files from the workspace area?