import data into uitable

7 views (last 30 days)
Radoslav Vandzura
Radoslav Vandzura on 7 Oct 2015
Commented: TastyPastry on 9 Oct 2015
I would like to ask you how shout I import data into uitable,mixed data - numbers and string? I have created uitable in guide. Here is part of my code:
global strFilename [num,txt,raw] = xlsread(strFilename) set(handles.edit3, 'data', num); -After that only numbers appear in uitable. set(handles.edit3, 'data', txt); -After that only words appear in uitable.
How can I resolve it?

Accepted Answer

TastyPastry on 7 Oct 2015
set(handles.edit3,'data',raw); should resolve the issue. uitable accepts either numeric arrays or cell arrays if you want mixed data types. The reason you're seeing only words appear when you use txt as your data variable is because the second output of xlsread ignores numbers.
TastyPastry on 9 Oct 2015
You can use calls to guidata() to save and retrieve the handles. Then, if you're running 2014b+ you can just use dot notation, or you'll need get(handles.edit3,'data').

Sign in to comment.

More Answers (0)


Find more on Oil, Gas & Petrochemical in Help Center and File Exchange


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!