How do I read data from just first row of the cell
Mostrar comentarios más antiguos

this is the 3x50 cell
4 comentarios
Geoff Hayes
el 17 de Ag. de 2018
Bajdar - what does
feature_vec(1,:)
return?
madhan ravi
el 17 de Ag. de 2018
Editada: madhan ravi
el 17 de Ag. de 2018
@Geoff Hayes shouldn’t it be feature_vec{1,:} because it’s a cell ? Just curious.
Image Analyst
el 17 de Ag. de 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
el 17 de Ag. de 2018
Thank you sir @ Image analyst
Respuesta aceptada
Más respuestas (2)
Yuvaraj Venkataswamy
el 17 de Ag. de 2018
Editada: Yuvaraj Venkataswamy
el 17 de Ag. de 2018
if true
feature_vec{1,:}
end
2 comentarios
Bajdar Nour
el 19 de Ag. de 2018
Yuvaraj Venkataswamy
el 20 de Ag. de 2018
You are welcome
Adusumilli Bala Surendra
el 24 de Abr. de 2019
1 voto
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
Categorías
Más información sobre Cell Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!