フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

add columns (as operations of original colms) at specific intervals in array w'out overwriting original colms

2 ビュー (過去 30 日間)
prerna kaul
prerna kaul 2014 年 3 月 21 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello,
i am a new student in matlab , i need a help
i have a array named " train_data " of size m x n (having m attributes and n examples)
i want to add "two" corresponding columns to each n columns of train_data
just for example:
0.0937 -0.0227 -0.0904 -0.0852 -0.0887
0.1397 -0.0505 0.0211 0.0095 -0.0267
0.0627 -0.0356 0.2087 -0.0134 0.0020
5 columns here , and i want 15 columns
no change in 1st col , multiply it with 2 ,multiply it with 4 and add them in next two columns respectively
do same for all the columns
how this can be done with m x n array ??

回答 (1 件)

Chandrasekhar
Chandrasekhar 2014 年 3 月 21 日
A = [0.0937 -0.0227 -0.0904 -0.0852 -0.0887
0.1397 -0.0505 0.0211 0.0095 -0.0267
0.0627 -0.0356 0.2087 -0.0134 0.0020]
then
A = [A(:,1) A(:,1)*2 A(:,1)*4 A(:,2) A(:,2)*2 A(:,2)*4 ....... A(:,5) A(:,5)*2 A(:,5)*4]

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by