How to extract specific row from a large csv file and reshape it

4 ビュー (過去 30 日間)
Minions
Minions 2021 年 3 月 1 日
編集済み: Minions 2021 年 3 月 2 日
I have several csv files with 64 columns and many rows. I need to extract the 1, 100,200,300 rows then reshape into 8,8 matrix and do the imaging of it. Can anyone give me some idea or guidelines to do that? Any kinds of idea will be really appreciated. For the convenience, I am attaching an example for the file.

採用された回答

Jan
Jan 2021 年 3 月 1 日
Data = csvread(FileName);
Row = [1, 100, 200, 300];
figure;
for iRow = 1:numel(Row)
Block = reshape(Data(iRow, :), 8, 8);
AxesH = subplot(1, numel(Row), iRow);
image(AxesH, Block); % Or how do you want to display?
end
  1 件のコメント
Minions
Minions 2021 年 3 月 2 日
編集済み: Minions 2021 年 3 月 2 日
Thank you so much for the help

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing and Computer Vision についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by