i need help please with the uitable function

how can i put the outputted data in a uitable i tried this but it didn't work out for me
%
clc
clear
input('welcome to the mud selection software 2.0, press (enter) to continue');
Ko=input('please enter the permeability of the formation in units of md: ');
dw=input('please enter the wellbore diameter in units of inch: ');
rw=(dw/(12*2));
fprintf('the wellbore radius is %2.4f ft \n',rw);
n=input('please input the number of mud types you have : ')
x = cell(1, n)
y = zeros(1, n)
z = zeros(1, n)
for i=1:n
x{i}=input('please enter the name of the mud type you have: ','s')
end
for j=1:n
y(j)=input ('please enter the permeability of the damaged zone corrisponding to each mud type in md: ')
end
for l=1:n
z(l)=input('please enter the depth of invasion corresponding to each mud type in units of ft: ')
end
[zSorted, index]=sort(z, 'ascend');
xSorted=x(index);
ySorted=y(index);
figure
rnames={'Mud type','Permeability of damaged zone','Depth of penetration'}
t=uitable('Data',[{zSorted};xSorted;ySorted],'RowName',rnames)
This is the error i keep getting
%
Error using vertcat
Dimensions of matrices being concatenated are not consistent.
Error in tryxxxxx (line 27)
t=uitable('Data',[{zSorted};xSorted;ySorted],'RowName',rnames)

 Respuesta aceptada

Walter Roberson
Walter Roberson el 18 de Mzo. de 2017
t = uitable('Data',[num2cell(zSorted); xSorted; num2cell(ySorted)],'RowName',rnames)

Más respuestas (1)

Image Analyst
Image Analyst el 17 de Mzo. de 2017

0 votos

Create a blank table, then just let the users type into it.

2 comentarios

Ahmed Ashraf
Ahmed Ashraf el 17 de Mzo. de 2017
how can i do that , sorry i'm new to matlab and can't i just do it the way it is written in the code?
You've accepted an answer so I guess you figured it out. For others who may be reading:
data = t.Data; % where t is the handle to your uitable.

Iniciar sesión para comentar.

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 17 de Mzo. de 2017

Comentada:

el 18 de Mzo. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by