フィルターのクリア

create a matrix with existing matrix

1 回表示 (過去 30 日間)
Elysi Cochin
Elysi Cochin 2013 年 12 月 3 日
編集済み: Andrei Bobrov 2013 年 12 月 3 日
i have a matrix with dimension
A = M * 361
i wanted to create a matrix with size
B = M * 3600
with this matrix A
how to do it??
also a matrix with dimension
C = N * 900
i wanted to create a matrix with size
D = N * 3600
how to do it?? please do reply...
with this matrix A
  4 件のコメント
ES
ES 2013 年 12 月 3 日
C to D is straightforward since number of rows in C and D are equal, and D has 4 times the columns in C.
D=repmat(C,1,4)
ES
ES 2013 年 12 月 3 日
編集済み: ES 2013 年 12 月 3 日
and for A to B you can use this workaround.
B=repmat(A,1,10)
B=B(:,1:3600);
I hope someone gives a straighter solution.

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

採用された回答

ES
ES 2013 年 12 月 3 日
編集済み: ES 2013 年 12 月 3 日
C and D have same number of rows. Similarly A and B have same number of rows. So C to D is straightforward since number of rows in C and D are equal, and D has 4 times the columns in C.
D=repmat(C,1,4)
and for A to B you can use this workaround.
B=repmat(A,1,10)
B=B(:,1:3600);
I hope someone gives a straighter solution.
  1 件のコメント
Elysi Cochin
Elysi Cochin 2013 年 12 月 3 日
thank you all for the reply....

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

その他の回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2013 年 12 月 3 日
編集済み: Andrei Bobrov 2013 年 12 月 3 日
One way:
newsize2 = 3600;
[i0,j0] = ndgrid(1:size(A,1),1:size(A,2));
F = griddedInterpolant(i0,j0);
[io,jo] = ndgrid(i0(:,1),linspace(1,j0(end),newsize2));
B = F(io,jo);
or
B = zeros(M,3600);
B = A(:,rem((1:size(B,2))-1,size(A,2))+1);

カテゴリ

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