How can I get select rows of a cell?
3 次查看(过去 30 天)
显示 更早的评论
I have a .txt file with some numbers in them Ax, Ay, Az, R, G, B, class but per row just 1 value.
Example:
1
5
3
100
150
200
1
When using c = textscan ('filename.txt', '%d');
It returns a cell?
I want to assign specific variable to a line but a cell doesn't work like an Array? I want to assign Ax to the first value in .txt file, Ay the second and so on.
Example: Ax = c{1,1}
Ay = c{2,1}
But it seems like with this code you can only select the whole column?
Thanks in advance!
1 个评论
Stephen23
2022-9-7
"It returns a cell?"
Yes: in general one cell per format specifier. You specified one numeric format, so a scalar cell array is expected.
As far as I can see, there is nothing stopping you from using basic cell indexing to access the content of that cell array:
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Export 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!