user interface - Import from a specific range of xlsx data in MATLAB GUI -


i have code portion in matlab m.file import electrical consumption data in xlsx file. program prompt user grid charges, necessary calculation, , plot bar chart displaying consumption cost every month , year. variables obtain in portion of code use in other parts of m.file

i created multi-page gui m.file using guide, being new user in matlab, struggling gui codings. importing file, want user able view , select range of import, , not entire file. thing struggling make data gui available other gui pages.

the gui have 2 panels. 1 panel contains 4 edit_text boxes user input grid charges, , 'enter' push button. other panel contains axes used display bar chart, 13 static text display value of monthly , annual cost after calculation done. want axes , 13 static text display bar chart , cost data after user had filled edit boxes necessary grid charges, followed clicking 'enter' push button.

i had seen examples of importing excel files in gui, i'd seen import file entirely, or hard little understanding of gui coding do. there simple solution this?

in matlab, xlsread function has parameters can specify sheet , range read in. http://www.mathworks.com/help/matlab/ref/xlsread.html

for range parameter, can specify range in excel

ex.

xlsread('filename', 'a1:b10') 

to read in first 10x2 cells.

however, suggest use microsoft's vba language in matlab import data depending how large excel file. find method more efficient larger data sets.

here example of how use if you're interested:

excelobj = actxserver('excel.application'); fileobj = excelobj.workbooks.open(filename); sheetobj = fileobj.worksheets.get('item', sheetnumber);  %read in ranges same way xlsread! indata = sheetobj.range('a1:b10').value; 

i not have experience gui building using guide, presume need add callback functions components wish interact user. in callback functions, can set boolean value indicates whether user has completed required actions start calculations.

best of luck!


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -