halfway merged and pulled?!

This commit is contained in:
Silas Labor Zizou
2025-12-15 15:41:02 +01:00
parent 7d0a634b87
commit b8cecae895
145 changed files with 19835 additions and 0 deletions

33
Functions/getFigureSize.m Normal file
View File

@@ -0,0 +1,33 @@
% GETFIGURESIZE Retrieve the size of the current MATLAB figure window.
% [WIDTH, HEIGHT] = GETFIGURESIZE() returns the width and height of the
% current figure in pixels.
%
% Example:
% % Get size of current figure
% [w, h] = getFigureSize();
% fprintf('Current figure is %d pixels wide and %d pixels tall.\n', w, h);
%
% Adapt snippet for other figures:
% % Suppose H is a handle to any MATLAB figure (existing or new):
% H = figure; % or H = <some existing figure handle>;
% % Retrieve current size of the active (or any) figure:
% [wCur, hCur] = getFigureSize();
% % Set the other figure H to match that size, preserving its position:
% posH = get(H, 'Position'); % [left, bottom, width, height]
% newPos = [posH(1), posH(2), wCur, hCur];
% set(H, 'Position', newPos);
%
% Note:
% - Position vector is given as [left, bottom, width, height] in pixels.
% - If you want to specify a custom size directly, you can replace wCur/hCur
% with desired values.
function [width, height] = getFigureSize()
% Ensure a figure is available
fig = gcf;
% Get the position vector: [left, bottom, width, height]
pos = get(fig, 'Position');
% Extract width and height
width = pos(3);
height = pos(4);
end