To read a cell array

To read a particular column of a cell array using the position of header name.

回答(1 个)

Example
A=num2cell(magic(5))
Col=3
A(:,col)

17 个评论

how to access the column data in uitable.
how to access the particular element in a cell array using strcmp
A=num2cell(magic(5))
t = uitable( 'Data',A)
% to read column 2
out=get(t,'Data')
col2=out(:,2)
how to access multiple columns using loops
you do not need loops to access multiple columns
A=num2cell(magic(5))
col=[1 2 4]
A(:,col)
ok thanks how to multiply the two cell array column
which cell array column?
have 719 X 2 cell, would like to divide or multiply the 2 columns within the cells
A=num2cell(rand(719,2)) % Example
p=cellfun(@times,A(:,1),A(:,2))
Or use @rdivide
error occurred as 'matrix dimensions must agree'
There is no error with my example, post your code
my code:
data = cellfun(@rdivide,meas(:,32),meas(:,33),'UniformOutput',false);
I have 60 numbers of columns in my "meas" file.
meas is a cell array or a file?
meas is a cell array of type cell
In windows command type
whos meas
what did you get?
Name = meas Size = 720x60 Bytes = 3112252 Class = cell Attributes =

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

提问:

2013-3-29

Community Treasure Hunt

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

Start Hunting!

Translated by