Use imagesc to plot data = magic(N); for N = 5:20. Arrange the 16 plots in a single figure window in a 4 by 4 grid, using handle graphs, not using subplot.

1 answer below »
Use imagesc to plot data = magic(N); for N = 5:20. Arrange the 16 plots in a single figure window in a 4 by 4 grid, using handle graphs, not using subplot.
Answered Same DayDec 08, 2021

Answer To: Use imagesc to plot data = magic(N); for N = 5:20. Arrange the 16 plots in a single figure window in...

Kshitij answered on Dec 10 2021
130 Votes
mainfile/autoArrangeFigures.m
function autoArrangeFigures(NH, NW, monitor_id)
if nargin < 2
N
H = 0;
NW = 0;
monitor_id = 1;
end
task_bar_offset = [30 50];
%%
N_FIG = NH * NW;
if N_FIG == 0
autoArrange = 1;
else
autoArrange = 0;
end
figHandle = sortFigureHandles(findobj('Type','figure'));
n_fig = size(figHandle,1);
if n_fig <= 0
warning('figures are not found');
return
end
screen_sz = get(0,'MonitorPositions');
screen_sz = screen_sz(monitor_id, :);
scn_w = screen_sz(3) - task_bar_offset(1);
scn_h = screen_sz(4) - task_bar_offset(2);
scn_w_begin = screen_sz(1) + task_bar_offset(1);
scn_h_begin = screen_sz(2) + task_bar_offset(2);
if autoArrange==0
if n_fig > N_FIG
autoArrange = 1;
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here