필터 지우기
필터 지우기

Matlab running minimised using task scheduler influences image plots

조회 수: 72 (최근 30일)
Jonathan
Jonathan 2024년 7월 29일 17:08
답변: Rahul 2024년 8월 9일 11:36
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
Walter Roberson
Walter Roberson 2024년 7월 30일 6:46
Does your script specify the PaperSize property for the figure ?
Rahul
Rahul 2024년 8월 7일 8:27
Hey @Jonathan, can you provide your MATLAB release version, and preferrably the script that is being run. That could help me address the exact issue.

댓글을 달려면 로그인하십시오.

답변 (1개)

Rahul
Rahul 2024년 8월 9일 11:36
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!

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by