Matlab running minimised using task scheduler influences image plots
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi, I have been running a matlab script on a daily basis using windows task scheduler for the past few weeks and have noticed that the output image plots appear compressed (the arrows and contours are squished together, implying some sort of scale issue(?)) when compared with running the same script with matlab already running on my desktop. My script does specify the dimensions of the figure, but these seem to be ignored. Is there a way to correct for this? Related, if I can resolve the former issues, is there a way to force Task Scheduler to run matlab so that it is maximised (not behind the scene).
I'm using the following in Task scheduler to initiate my script:
matlab -r "cd('C:\MatlabScripts\'); run scriptname.m; pause(10)"
Thank you for any thoughts on this,
Jon
댓글 수: 3
답변 (2개)
Rahul
2024년 8월 9일
Hi Jonathan,
I am unable to reproduce this issue, in the latest R2024a release of MATLAB, using the commands specified in the question.
Although, you can refer to this previously documented question regarding task scheduling of scripts in MATLAB:
You can refer to the following code snippet of a MATLAB script that shows an image and plot as subplots in a figure with a custom position used, which seems to be working fine without any compression:
% Reading an image file
im = imread('full_path_to_image');
% Initializing a figure
f = figure('Position',[200 200 600 500]);
% Plotting on the same figure
subplot(2, 1, 1);
imshow(im);
% Plotting as second subfigure
subplot(2, 1, 2);
% Line Plot of a random vector
plot(rand(1, 255));
Subsequently, you can have the MATLAB window run in the background as minimized or maximized by checking or unchecking the ‘Hidden’ Toggle Button in the properties of your scheduled task (in case of Windows 11), respectively:
For further information regarding scheduling tasks related to MATLAB scripts and functions you can refer to similar questions in the MATLAB Answers Community:
Hope this helps!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!