have 2 questions in app designer. Need to convert a char array to a string and also extract coordinates on mouse up event
Mostrar comentarios más antiguos
attached is a QA inspection tool
I am having problems with 2 things.
- We need to printout the file name (file name of the image that is loaded at the start) into the GUI text box (filenameeditfield). I keep getting errors when converting the char array to a string. I have tried about 3 or 4 different examples and none seem to work and Im so confused as this should be straight forward?
see function "openfile". A few tries that were made that dont work are shown below.
% app.FileNameEditField.Value =string(strjoin(cellstr(file))) ; strcat(file{:});
% app.FileNameEditField.Value = convertCharsToStrings(file)
% app.FileNameEditField.Value = string(file);
- The 2nd part of the QA is finding the center point of a round beam on a image (loaded from the file). The user should click the button to find the center and then an outline is made around the beam, showing the pereimter of the beam with respect the center point selectedf. The points currently are registered right when the user clicks the first time. However, its hard for the user to click right in the center on the first shot. I would like the user to be able to use a mouse up rather than mouse down event so they can move (slide) the center position around to visually find the center. I cant figure out how to do this.
This is under function FindCenterButtonPushed(app, event)
The point is drawn here: roiPOC = drawpoint(app.UIAxes_2); %Use Mouse To Select a
I attached the file and an example of an image we are processing.
Really appreciate the help in advance
1 comentario
Walter Roberson
el 3 de Mzo. de 2025
You indicate that file is a char array. Is it a char array with multiple rows?
If file is a single row character vector, then
app.FileNameEditField.Value = file;
should work.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Update figure-Based Apps en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


