Value Interpolation.

A matrix (1:400) has some value at 1 followed by 7 zeros then value at 9 followed by 7 zeros and so on uptil 400. To be more clear the sequence is like 1+i,0,0,0,0,0,0,0,-1+i,0,0,0,0,0,0,0.....-1-i,0,0,0,0,0,0,0. How to make this sequence as 1+i,1+i,1+i,1+i,1+i,1+i,1+i,1+i,-1+i,-1+i,-1+i,-1+i,-1+i,-1+i,-1+i,-1+i. Please let me know if anyone know this. Thanks for your time.

 採用された回答

Sean de Wolski
Sean de Wolski 2012 年 3 月 30 日

0 投票

A = your_matrix;
B = reshape(repmat(A(1:8:end),7,1),1,[]);
%extract values we care about/copy 'em/reshape to vector

1 件のコメント

Santosh
Santosh 2012 年 3 月 30 日
Thanks Sean! :)

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

その他の回答 (1 件)

Bjorn Gustavsson
Bjorn Gustavsson 2012 年 3 月 30 日

0 投票

V_interesting = V_with0(1:8:end);
HTH

1 件のコメント

Santosh
Santosh 2012 年 3 月 30 日
Thanks! :)

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

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by