Multiply/divided two tables
古いコメントを表示
How would I mulyiply two tables togther. I have one table and I took two columns from the table and I want to multiply them togther. Also how would I divide as well thanks.
採用された回答
その他の回答 (1 件)
Jon
2020 年 11 月 13 日
% suppose you have a table T1 and T2 you could do something like
A = [T1.myColumnName1 T1.myColumnName2]
B = [T2.myColumnName3 T2.myColumnName4]
C = A.*B % assuming you want element by element multiplication
D = A./B % assuming you want element by element division
3 件のコメント
KALYAN ACHARJYA
2020 年 11 月 13 日
Example:
data1=randi(20,[10,1]);
data2=randi(20,[10,1]);
table1=table(data1,data2)
data1=randi(10,[10,1]);
data2=randi(10,[10,1]);
table2=table(data1,data2)
% Multiple table 1,table2
data1=table1.data1.*table2.data1;
data2=table1.data2.*table2.data2;
result_mul_table=table(data1,data2)
Yogesh Bhambhwani
2020 年 11 月 13 日
Jon
2020 年 11 月 13 日
Assuming as Steven Lord suggests that you want to add the new computed column in the same table following your verbal description:
T.newColumn = myNumericalValue*T.oneColumn.*T.anotherColumn./T.yetAnotherColumn
If you just want to have that as a vector you could assign the left hand side to your vector, v
v = myNumericalValue*T.oneColumn.*T.anotherColumn./T.yetAnotherColumn
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
