简体   繁体   English

如何从GUI Matlab中提取数据/图形?

[英]how to extract data/figure from GUI Matlab?

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. 我有这个matlab GUI(当然不是由我制作的),而且我一直在寻找近一周的时间,我怎么可能从中提取数据而没有成功。 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!): 我以为我会把GUI放在这里以防万一有人想给它一个机会和帮助(如果他们可以帮助我,我愿意付钱给别人!):

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

This is how you produce the image: 这是您生成图像的方式:

  1. open spec_gui 打开spec_gui
  2. click file, open, select FocusedInfinity.mat 单击文件,打开,选择FocusedInfinity.mat
  3. press "Calculate" 按“计算”
  4. push buttons 按按钮

    A."XY Profile" & "DimSum" with Elem slider set to "1" A.“XY配置文件”和“DimSum”,Elem滑块设置为“1”

    B."XY Profile" & "DimSum" with Elem slider set to "5" B.“XY轮廓”和“DimSum”,Elem滑块设置为“5”

  5. the top window will display an image: 顶部窗口将显示图像:

在此输入图像描述

Here's how I'd attack this. 这是我如何攻击这个。

  1. Open the figure in GUIDE. 在GUIDE中打开图。 右键单击和指南
  2. That opens the GUIDE editor like so: 这样就打开了GUIDE编辑器: 指南

  3. Right click on the Calculate button and look at the Property Inspector . 右键单击Calculate按钮,然后查看Property Inspector 右键单击属性

  4. Then you can look at the properties, look for Callbacks of any type that are defined. 然后,您可以查看属性,查找已定义的任何类型的Callbacks 检查员

  5. Click the Callback worksheet with a pencil icon and it brings up the editor with spec_gui.m and the calcbtn_Callback . 单击带有铅笔图标的Callback工作表,它将使用spec_gui.mcalcbtn_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. 这是计算数字的原因,您可以重复此过程以查看“XY配置文件”和“DimSum”和Elem滑块回调是什么以及它们的作用。 It'll be a little bit of work, but you'll get it. 这将是一点点工作,但你会得到它。 Otherwise SO is here to help. 否则SO会在这里提供帮助。 :-) :-)

OK I DID IT! 好吧,我知道了!

With a combo of what MACDUFF and DANGKHOA (thanks so much guys) said and a few hours later! 随着MACDUFF和DANGKHOA的组合(非常感谢那些家伙)说几个小时后!

  1. I found out which line in the code the buttons are being utilized (ie what MAC DUFF said) 我发现代码中的哪一行按钮被使用(即MAC DUFF说的是什么)

  2. I put a "keyboard" right after, but before the end of the code (ie what DAN KHOA said) 我在之后,但在代码结束之前放了一个“键盘”(即DAN KHOA所说的)

  3. When I started the GUI and calculation and pressed the button the matlab script displayed "k" 当我启动GUI并计算并按下按钮时,matlab脚本显示“k”

  4. I typed in figure 我输入了图

  5. then "imagesc(im)", which "im" was what the GUI was saving the image data as. 然后是“imagesc(im)”,其中“im”是GUI将图像数据保存为。

BINGO! 答对了! Thanks guys...so much work sigh 谢谢你们......这么多工作感叹 在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM