How to select an input using the GUI / explorer window in MATLAB?

Actually I have 2 questions:

  • How to display variable data in msgbox? In other words, if I have dist=3765at the end of my program and I want to display it in msgbox, how to do it?

  • I want the user to select an input file (suppose an image) from a folder in my MATLAB program using the explorer window at run time. How do I encode this in MATLAB or is there an existing function for it?

+3
source share
1 answer

MathWorks ( ) , MATLAB. , , , :

  • MSGBOX, . . , dist, , , ( INT2STR):

    hMessage = msgbox(['dist = ' int2str(dist)]);
    

    alt text

  • UIGETFILE, . , MATLAB (*.m, *.fig, *.mat ..) :

    [fileName,filePath] = uigetfile();
    

    alt text

+5

Source: https://habr.com/ru/post/1721425/


All Articles