How can I display an integer with a number of digits in uitable?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Le Huy
il 11 Set 2015
Commentato: Walter Roberson
il 12 Set 2015
Hi everyone!
Particularly, I have:
A=[1 6 8; 0.2554 1.6641 1.123]
Is it possible to display it in uitable as :
1.0000 6.0000 8.0000 ; 0.2554 1.6641 1.1230.
Thank you all too much!
0 Commenti
Risposta accettata
Walter Roberson
il 11 Set 2015
Set the ColumnFormat to {'short', 'short', 'short'}
3 Commenti
Walter Roberson
il 12 Set 2015
Darn, it treats the outputs differently than I expected.
You will need to output as strings.
Astr = reshape(cellstr(num2str(A(:),'%.4f')),size(A));
Then set the Data property of the uitable to Astr.
If you allow the user to edit the table and then you read in the values remember that they will be strings so use str2double() to convert them to numbers.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Dialog Boxes in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!