edit-replacing a value by another

3 ビュー (過去 30 日間)
kash
kash 2012 年 2 月 9 日
I have a matrix
[1 2 3 4 5 6
11 58 12 8 2 12
2 10 36 69 1 20
14 85 94 20 36 5
19 58 41 52 69 87
10 25 36 78 01 25]
in first column [1 11 2 14 19 20]
each pair values must be repcaed by a value..
my 1st column outputmust be =[.1 .2 .3]
for second column my values must be .2 .4 .6
2nd column=[.2 .4 .6]
the values which are replaced is selected by user
i have 100x6 matrix please help
  1 件のコメント
Image Analyst
Image Analyst 2012 年 2 月 9 日
Why does your final output have only 3 values instead of 6. Shouldn't the first column be [.1 .1 .2 .2 .3 .3]? Or is it something else? If it's just 3 then which row of the pair should you throw out?

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

採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 2 月 9 日
:0
A = randi(50,100,6); % Your matrix
n = size(A,1)/2;
n1 = cumprod([(1:n).',2*ones(n,size(A,2))],2)*.1;
  1 件のコメント
kash
kash 2012 年 2 月 9 日
Thanks andrei

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by