Filter löschen
Filter löschen

Matlab running minimised using task scheduler influences image plots

72 Ansichten (letzte 30 Tage)
Jonathan
Jonathan am 29 Jul. 2024 um 17:08
Beantwortet: Rahul am 9 Aug. 2024 um 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 Kommentare
Walter Roberson
Walter Roberson am 30 Jul. 2024 um 6:46
Does your script specify the PaperSize property for the figure ?
Rahul
Rahul am 7 Aug. 2024 um 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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Rahul
Rahul am 9 Aug. 2024 um 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!

Kategorien

Mehr zu Graphics Performance finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by