I am trying to transform a column of data

4 ビュー (過去 30 日間)
jfrazie9
jfrazie9 2018 年 3 月 15 日
回答済み: Akira Agata 2018 年 3 月 16 日
I have a 22x4 double in a .mat file currently. To use this data I need to change the first column into a function of itself. I need that column to be the value of the second column value divided by the first column value for all 22 rows. The end product will stay the 22x4 double but will have different values in the first column. How do I go about this? Thank you.

採用された回答

Akira Agata
Akira Agata 2018 年 3 月 16 日
Assuming A is your 22-by-4 double array, the following can replace first column value by the "second column value divided by the first column value"
A(:,1) = A(:,2)./A(:,1);

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by