How to extract data?

3 ビュー (過去 30 日間)
Nisar Ahmed
Nisar Ahmed 2020 年 10 月 29 日
コメント済み: Image Analyst 2020 年 10 月 29 日
My data consists of 181 rows and 91 columns like (size(gather) 181 91). I want to extract like 181 rows and first 19 columns (column 1 to 19) with new dimensions (size(gather) 181 19). How I can do it?

採用された回答

KSSV
KSSV 2020 年 10 月 29 日
A = rand(181,91) ;
iwant = A(:,1:19) ;
  4 件のコメント
Nisar Ahmed
Nisar Ahmed 2020 年 10 月 29 日
OK, so by taking transpose...
Image Analyst
Image Analyst 2020 年 10 月 29 日
You can also use (:):
% columnVector is 181x1 while rowVector is 1x181.
columnVector = rowVector(:); % Using (:)
columnVector = rowVector'; % Second option using ' to transpose.
They're not completely identical for multi-dimensional arrays, though they are for row vectors. Using (:) will work for any dimension to turn it into a column vector, for example turn a 2-by-8 into a 16-by-1. The ' does a transpose, and so would turn a 2-by-8 into a 8-by-2. If rowVector is complex, I think you might have to use dot apostrophe rather than just apostrophe.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLog Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by