フィルターのクリア

Matrix manipulation, turning a column vector into a square matrix?

10 ビュー (過去 30 日間)
Kieran
Kieran 2013 年 10 月 15 日
編集済み: Nishitha Ayyalapu 2013 年 10 月 15 日
say i have a matrix with things in it, and things are each column vectors 10000 in length,
data = [ thing1(:) thing2(:) thing3(:) thing4(:) ]
how can i manipulate data so that i can turn each of these things into separate outputs that are 100*100 in size
thanks

採用された回答

Image Analyst
Image Analyst 2013 年 10 月 15 日
thing100x100 = rehape(thing1, [100, 100]); % Reshape 10,000 elements into 100x100

その他の回答 (1 件)

Nishitha Ayyalapu
Nishitha Ayyalapu 2013 年 10 月 15 日
編集済み: Nishitha Ayyalapu 2013 年 10 月 15 日
This should do the job if you have four column vectors:
data = [reshape(data(:,1),100,100) reshape(data(:,2),100,100)...
reshape(data(:,3),100,100) reshape(data(:,4),100,100)]
and each of those things would be, for example:
thing1 = reshape(data(:,1),100,100);

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by