Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: displaying data in a uitable.
Replies: 1   Last Post: Dec 20, 2012 6:47 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Barry Shaw

Posts: 32
Registered: 2/16/12
Re: displaying data in a uitable.
Posted: Dec 20, 2012 6:47 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Barry Shaw" <Barry@h.com> wrote in message <kaupf9$fta$1@newscl01ah.mathworks.com>...
> Hi.
>
> Simplified version of my problem.....
> If I have the variable 'cor' below, I can display it in a uitable using the following code.

> >> cor = {[0.1 0.2];[0.1 0.2]};
> >> cor = cellstr(num2str(cell2mat(cor)));
> >> uitable('Data',cor)

>
> I run into difficulties when I have 'cor' of the form

> >> cor = {[0.1 0.2];[0.1 0.2 0.3]};
> or
> >> cor = {[0.1 0.2];[0.1 0.2];'N/A'};
>
> I can't figure out how to display this in uitable. Problem is either because (1) the doubles in each row are of different sizes, or (2) rows are of a different data type.
>
> Also, I could have 1000's of rows, so I don't really want to implement any loops.
>
> Any suggestions please?
>
> Thanks


Man! Played a little more and it turned out to be very easy in the end.
>> cor = {[0.1 0.2];[0.1 0.2 0.3];'N/A'};
>> cellfun(@num2str,cor,'UniformOutput',false)




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.