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)

 采纳的回答

t = uitable('Data',[num2cell(zSorted); xSorted; num2cell(ySorted)],'RowName',rnames)

更多回答(1 个)

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

2 个评论

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.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Mathematics 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by