index multiple columns in cell array

7 ビュー (過去 30 日間)
Robert Fischer
Robert Fischer 2020 年 9 月 24 日
コメント済み: Robert Fischer 2020 年 9 月 24 日
Hi, I am still pretty new to Matlab.
I import data from a txt file into a cell-array (ccc). Now I want to retrieve multiple rows and columns:
e.g. myAnimals.monkeys = cell2mat(cellfun(@(x) str2num(char(x)),ccc(5:59,8:10),'UniformOutput',0));
which works fine.
but how do I retrieve e.g. columns 8 to 10 AND 15-18 at the same time?
many thanks, Robert

採用された回答

madhan ravi
madhan ravi 2020 年 9 月 24 日
Replace 8:10
With
[8:10, 15:18]
  1 件のコメント
Robert Fischer
Robert Fischer 2020 年 9 月 24 日
Thx a lot!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by