Multiplying two variables in a table together

2 次查看(过去 30 天)
How would you multiply two variables/columns together from a table together, to create a new variable/column?
Lets say for example you have the following table:
Time Voltage Current
_____ _____ _____
1 8 2
2 9 4
3 6 6
And you want to multiply voltage and current together at each sample.
So you'd end up with a 4th column/variable called power that is voltage multiplied by current at each time interval

采纳的回答

Voss
Voss 2024-3-5
T.Power = T.Voltage.*T.Current;
where T is your table.
  3 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by