get new column using existing columns
3 ビュー (過去 30 日間)
古いコメントを表示
I have to do two things
- I have a 13 colums and from that i need to compute value and make new column i have tried to do it like this but it give only zerows for each raw
- i need to save the file with the new column as 14 column data sheet
note: data set has about 1milion raws and 13 columns
the data is in a out put name Result2
Result2 = [D1, D2, D3, D4, D12, Ex, Az, Am, Te, IRR1, IRR2, IRR3, IRR4];
new colum i need is rat1
rat1 = (Result2(:,12). *2)/((Result2(:,11) + Result2(:,13))/2)
final output should be like below
Result3 = [D1, D2, D3, D4, D12, Ex, Az, Am, Te, IRR1, IRR2, IRR3, IRR4, rat1];
note since data file is two large this massage comes it asked to use matlab v7.3 or above please tel me the way i can generate the above Result3 file thank you verry mutch
2 件のコメント
Dyuman Joshi
2022 年 7 月 22 日
編集済み: Dyuman Joshi
2022 年 7 月 22 日
Dot is missing for element wise division.
Also, since the data is quite large, directly append the data as the last column, rather than storing it.
Result2 = [D1, D2, D3, D4, D12, Ex, Az, Am, Te, IRR1, IRR2, IRR3, IRR4];
Result2 = [Result2 2*Result2(:,12)./(Result2(:,11) + Result2(:,13))/2];
%or
Result2(:,14)=2*Result2(:,12)./(Result2(:,11) + Result2(:,13))/2;
I think the latter would be faster.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!