필터 지우기
필터 지우기

Multiplying two variables in a table together

조회 수: 6 (최근 30일)
AluminiumMan
AluminiumMan 2024년 3월 5일
댓글: Voss 2024년 3월 5일
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
AluminiumMan
AluminiumMan 2024년 3월 5일
This worked. Thank you
Voss
Voss 2024년 3월 5일
You're welcome!

댓글을 달려면 로그인하십시오.

추가 답변 (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