How do I read data from just first row of the cell
Show older comments

this is the 3x50 cell
4 Comments
Geoff Hayes
on 17 Aug 2018
Bajdar - what does
feature_vec(1,:)
return?
madhan ravi
on 17 Aug 2018
Edited: madhan ravi
on 17 Aug 2018
@Geoff Hayes shouldn’t it be feature_vec{1,:} because it’s a cell ? Just curious.
Image Analyst
on 17 Aug 2018
madhan, no. Just try it and see
for row = 1 : 3
for col = 1 : 50
ca{row, col} = rand(1, 4);
end
end
row1 = ca(1,:) % Correct.
row1 = ca{1,:} % Incorrect.
The first way gives the entire row while the braces way gives only the first cell of the first row. See the FAQ on cell arrays.
madhan ravi
on 17 Aug 2018
Thank you sir @ Image analyst
Accepted Answer
More Answers (2)
Yuvaraj Venkataswamy
on 17 Aug 2018
Edited: Yuvaraj Venkataswamy
on 17 Aug 2018
if true
feature_vec{1,:}
end
Adusumilli Bala Surendra
on 24 Apr 2019
1 vote
The following can help you. Try this.
z =
1×3 cell array
{3×3 double} {3×3 double} {3×3 double}
>> z{1}
ans =
0.00315 + 0.011925i 0.0008042 + 0.0071843i 0.0008042 + 0.0061306i
0.0008042 + 0.0071843i 0.00315 + 0.011925i 0.0008042 + 0.0065829i
0.0008042 + 0.0061306i 0.0008042 + 0.0065829i 0.00315 + 0.011925i
>> z{1}(1,:)
ans =
0.00315 + 0.011925i 0.0008042 + 0.0071843i 0.0008042 + 0.0061306i
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!