To read a cell array
이전 댓글 표시
To read a particular column of a cell array using the position of header name.
답변 (1개)
Azzi Abdelmalek
2013년 3월 29일
Example
A=num2cell(magic(5))
Col=3
A(:,col)
댓글 수: 17
sarfudeen
2013년 3월 29일
sarfudeen
2013년 3월 29일
Azzi Abdelmalek
2013년 3월 29일
편집: Azzi Abdelmalek
2013년 3월 29일
A=num2cell(magic(5))
t = uitable( 'Data',A)
% to read column 2
out=get(t,'Data')
col2=out(:,2)
sarfudeen
2013년 3월 29일
Azzi Abdelmalek
2013년 3월 29일
you do not need loops to access multiple columns
A=num2cell(magic(5))
col=[1 2 4]
A(:,col)
sarfudeen
2013년 3월 29일
Azzi Abdelmalek
2013년 3월 29일
which cell array column?
Azzi Abdelmalek
2013년 3월 29일
p=cellfun(@times,col1,col2)
sarfudeen
2013년 3월 29일
Azzi Abdelmalek
2013년 3월 29일
편집: Azzi Abdelmalek
2013년 3월 29일
A=num2cell(rand(719,2)) % Example
p=cellfun(@times,A(:,1),A(:,2))
Or use @rdivide
sarfudeen
2013년 3월 29일
Azzi Abdelmalek
2013년 3월 29일
There is no error with my example, post your code
sarfudeen
2013년 3월 29일
Azzi Abdelmalek
2013년 3월 29일
meas is a cell array or a file?
sarfudeen
2013년 3월 29일
Azzi Abdelmalek
2013년 3월 29일
편집: Azzi Abdelmalek
2013년 3월 29일
In windows command type
whos meas
what did you get?
sarfudeen
2013년 3월 29일
카테고리
도움말 센터 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!