二つの数字の引き算

写真のように、数字が2秒ごとに列に並んでいるのですが、全ての列を引き算するプログラミングは作れるでしょうか?
例えば、写真でいうと(35.01-33.69)、(35.24-33.91)、(35.55-33.92).......のように全ての列を引き算したいです。

Respuestas (1)

Atsushi Ueno
Atsushi Ueno el 24 de Oct. de 2022
Editada: Atsushi Ueno el 24 de Oct. de 2022

0 votos

TT = {datetime(2022,10,24,12,06,29), 33.69, 33.91, 33.92, 33.29; % 6列目以降は省略
datetime(2022,10,24,12,06,30), 35.01, 35.24, 35.55, 34.72}
TT = 2×5 cell array
{[24-Oct-2022 12:06:29]} {[33.6900]} {[33.9100]} {[33.9200]} {[33.2900]} {[24-Oct-2022 12:06:30]} {[35.0100]} {[35.2400]} {[35.5500]} {[34.7200]}
diff = cellfun(@minus,TT(2,:),TT(1,:),'uni',false) % 2行目から1行目を引く
diff = 1×5 cell array
{[00:00:01]} {[1.3200]} {[1.3300]} {[1.6300]} {[1.4300]}

Categorías

Más información sobre データ型 en Centro de ayuda y File Exchange.

Productos

Versión

R2020b

Etiquetas

Preguntada:

海
el 24 de Oct. de 2022

Editada:

el 24 de Oct. de 2022

Community Treasure Hunt

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

Start Hunting!