Borrar filtros
Borrar filtros

Display mean +/- std in a table or matrix

16 visualizaciones (últimos 30 días)
Lily
Lily el 4 de Nov. de 2012
Hi, is it possible to display in a matrix or table (e.g. uitable) numbers like: 5 setstr(177) 4.5 6 setstr(177) 6.4 where setstr(177) is +/- sign? That is mean +/- of std.

Respuesta aceptada

Image Analyst
Image Analyst el 5 de Nov. de 2012
Editada: Image Analyst el 5 de Nov. de 2012
You can construct a uitable, either easily in GUIDE, or do it yourself via code with uitable(). Then load up a cell array with whatever (numbers, strings, etc.) and set the data property equal to it
clc;
clearvars;
close all;
% Create sample data and row and column headers.
columnHeaders = {'n', 'Data Set #1', 'Data Set #2'};
for n=1:10,
rowHeaders{n} = sprintf('Row #%d', n);
tableData{n,1} = n;
tableData{n,2} = 10*rand(1,1);
tableData{n,3} = sprintf('Value = %.2f %s %.2f', rand(1,1), 177, rand(1));
end
% Create the table and display it.
hTable = uitable();
% Apply the row and column headers.
set(hTable, 'RowName', rowHeaders);
set(hTable, 'ColumnName', columnHeaders);
% Display the table of values.
set(hTable, 'data', tableData);
% Size the table.
set(hTable, 'units', 'normalized');
set(hTable, 'Position', [.1 .1 .8 .8]);
set(hTable, 'ColumnWidth', {40, 120, 180});
set(gcf,'name','Image Analysis Demo','numbertitle','off')

Más respuestas (1)

Matt J
Matt J el 4 de Nov. de 2012
Editada: Matt J el 4 de Nov. de 2012
Yes, but you would probably have to convert the other numeric data to type char, e.g.,
>> [num2str(5) ' ' char(177) ' ' num2str(4.5)]
ans =
5 ± 4.5
  2 comentarios
Lily
Lily el 4 de Nov. de 2012
Is it possible to constrct a matrix or a table with many numbers like 5+/-4.5?
Matt J
Matt J el 4 de Nov. de 2012
Of course!

Iniciar sesión para comentar.

Categorías

Más información sobre Tables en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by