how to extract data/figure from GUI Matlab?

允我心安 提交于 2019-12-11 16:42:12

问题


I have this matlab GUI (not made by me of course), and I have been looking everywhere for almost about a week on how I can possibly extract the figures from it to no success. I am at my wits end and was wondering if any one could help?

I want to be able to copy the figure (and save to desktop to extract data from after), or copy the data in a form of a matrix that I can manipulate and save. I thought I'd put the GUI here in case anyone wants to give it a shot and help (I'd be willing to paypal someone cash if they can help me!):

http://www.mediafire.com/?vqxymayztac3bvp

This is how you produce the image:

  1. open spec_gui
  2. click file, open, select FocusedInfinity.mat
  3. press "Calculate"
  4. push buttons

    A."XY Profile" & "DimSum" with Elem slider set to "1"

    B."XY Profile" & "DimSum" with Elem slider set to "5"

  5. the top window will display an image:


回答1:


Here's how I'd attack this.

  1. Open the figure in GUIDE.

  2. That opens the GUIDE editor like so:

  3. Right click on the Calculate button and look at the Property Inspector.

  4. Then you can look at the properties, look for Callbacks of any type that are defined.

  5. Click the Callback worksheet with a pencil icon and it brings up the editor with spec_gui.m and the calcbtn_Callback.

    % --- Executes on button press in calcbtn.
    function calcbtn_Callback(hObject, eventdata, handles)
    
    h=handles.param;
    h.nu=linspace(h.extfreq(1),h.extfreq(2),h.n_freq);
    [handles.pList,handles.data]=speccalc('nfile','temp','spec',h.spec, ...
            'gamma',h.gamma,'ng',h.n_mode,'nu',h.nu,'np',h.n_r,'silent',1, ...
            'dim',1:h.n_dim,'m',h.m','cart',h.cart);
    handles.file='temp.mat';
    handles=update_data(hObject, [], handles);
    update(hObject, [], handles);
    

This is what calculates the figure, you can repeat this process to see what the "XY Profile" & "DimSum" and Elem slider callbacks are and what they do. It'll be a little bit of work, but you'll get it. Otherwise SO is here to help. :-)




回答2:


OK I DID IT!

With a combo of what MACDUFF and DANGKHOA (thanks so much guys) said and a few hours later!

  1. I found out which line in the code the buttons are being utilized (ie what MAC DUFF said)

  2. I put a "keyboard" right after, but before the end of the code (ie what DAN KHOA said)

  3. When I started the GUI and calculation and pressed the button the matlab script displayed "k"

  4. I typed in figure

  5. then "imagesc(im)", which "im" was what the GUI was saving the image data as.

BINGO! Thanks guys...so much work sigh



来源:https://stackoverflow.com/questions/17237381/how-to-extract-data-figure-from-gui-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!