Multiplying two columns from two excel sheets in MATLAB
2 ビュー (過去 30 日間)
古いコメントを表示
Hello there,
I have two excel files. In both files, I have two coumns in each file. In one column the values are time values(x-axis) and the other column is my data(y-axis) at corresponding time values. This scenario is true for both the files. The time data range is same in both the coumns of both the excel files. Now I want to multiply the the data values (in y-asis) of both files with each other keeping the time range as it is. I mean, I just want to multuply the y-columns (or 2nd) column of both the excel files with each other.
It would be great if anyone could provide a MATLAB code for this operation. Any kind of help would be highly appreciated.
Thank you
0 件のコメント
回答 (1 件)
Ameer Hamza
2020 年 10 月 20 日
If both files have same number of rows
data1 = readmatrix('file1.xlsx');
data2 = readmatrix('file2.xlsx');
out = data1(:,1).*data2(:,1);
If they have different number of rows then use interp1() first to make them equal.
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Import from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!