Bonjour à tous,
Je souhaite mettre en pause l'éxecution du programme suivant :
La fonction "grabit" prend en entrée un fichier image. Il ouvre une fenêtre permettant de sélectionner des points sur l'image et d'en enregistrer les coordonnées (après définition d'un repère). Ces coordonnées sont par la suite utilisées dans ma fonction "center_of-motion".
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 clear all close all clc % GRABIT Extracts data points from an image file. % GRABIT starts a GUI program for extracting data from an image file. % It is capable of reading in BMP, JPG, TIF, GIF, and PNG files (anything % that is readable by IMREAD). Multiple data sets can be extracted from a % single image file, and the data is saved as an n-by-2 matrix variable in % the workspace. It can also be renamed and saved as a MAT file. grabit('Plt_travers.png') % Modify the input file wait d = dir('D:\Users\xxx); number_of_surfaces=length(find([d.isdir]==0))-5; % Number of files in the folder % In order to take into account the number of data files, we substract % the number of .m, .txt and .png files. % center_of_motion uses the centroid.m function. % CENTROID Compute centroid (center of mass) of a set of points % PTS = centroid(POINTS) % PTS = centroid(PTX, PTY) % Computes the ND-dimensional centroid of a set of points. % POINTS is an array with as many rows as the number of points, and as % many columns as the number of dimensions. % PTX and PTY are two column vectors containing coordinates of the % 2-dimensional points. % The result PTS is a row vector with Nd columns. center_of_motion(number_of_surfaces) % Gives the main Center Of Motion
Mon idée est de bloquer l'éxecution du programme tant que la figure ouverte par la fonction "grabit" n'est pas volontairement fermée par l'utilisateur. C'est à dire que tant que l'ensemble des points n'ont pas été relevé, le programme ne va pas lancer l'éxecution de la fonction "center_of_motion".
Après avoir parcouru l'aide Matlab ainsi que la FAQ, je n'ai pas trouvé de réponse me permettant la mise en pause de mon programme.
Si quelqu'un a déja rencontré cette situation, cela serait sympa de faire partager son expérience.
Merci d'avance pour vos réponses,
Maxime
Partager