To read a cell array
Ältere Kommentare anzeigen
To read a particular column of a cell array using the position of header name.
Antworten (1)
Azzi Abdelmalek
am 29 Mär. 2013
Example
A=num2cell(magic(5))
Col=3
A(:,col)
17 Kommentare
sarfudeen
am 29 Mär. 2013
sarfudeen
am 29 Mär. 2013
Azzi Abdelmalek
am 29 Mär. 2013
Bearbeitet: Azzi Abdelmalek
am 29 Mär. 2013
A=num2cell(magic(5))
t = uitable( 'Data',A)
% to read column 2
out=get(t,'Data')
col2=out(:,2)
sarfudeen
am 29 Mär. 2013
Azzi Abdelmalek
am 29 Mär. 2013
you do not need loops to access multiple columns
A=num2cell(magic(5))
col=[1 2 4]
A(:,col)
sarfudeen
am 29 Mär. 2013
Azzi Abdelmalek
am 29 Mär. 2013
which cell array column?
Azzi Abdelmalek
am 29 Mär. 2013
p=cellfun(@times,col1,col2)
sarfudeen
am 29 Mär. 2013
Azzi Abdelmalek
am 29 Mär. 2013
Bearbeitet: Azzi Abdelmalek
am 29 Mär. 2013
A=num2cell(rand(719,2)) % Example
p=cellfun(@times,A(:,1),A(:,2))
Or use @rdivide
sarfudeen
am 29 Mär. 2013
Azzi Abdelmalek
am 29 Mär. 2013
There is no error with my example, post your code
sarfudeen
am 29 Mär. 2013
Azzi Abdelmalek
am 29 Mär. 2013
meas is a cell array or a file?
sarfudeen
am 29 Mär. 2013
Azzi Abdelmalek
am 29 Mär. 2013
Bearbeitet: Azzi Abdelmalek
am 29 Mär. 2013
In windows command type
whos meas
what did you get?
sarfudeen
am 29 Mär. 2013
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!