How to make operation row by row
Show older comments
Hello experts,
this is my code contain:
Alpha_pmp is 400,000 row data
AirTemp is 105200 row data
Tstc is 400,000 row data
below is the formula to calculate FtempN
i can get all the result by using below code:
FtempN =((1 + (Alpha_pmp(1)).* (AirTemp(:,1)-(Tstc(1)))))
if i use above code matlab will return on single row result.
my question is how to to calculate result A by read row by row
for Alpha_pmp and Tstc?
example :
FtempN =((1 + (Alpha_pmp(2)).* (AirTemp(:,1)-(Tstc(2)))))
FtempN =((1 + (Alpha_pmp(3)).* (AirTemp(:,1)-(Tstc(3)))))
FtempN =((1 + (Alpha_pmp(4)).* (AirTemp(:,1)-(Tstc(4)))))
FtempN =((1 + (Alpha_pmp(5)).* (AirTemp(:,1)-(Tstc(5)))))
FtempN =((1 + (Alpha_pmp(6)).* (AirTemp(:,1)-(Tstc(6)))))
until last row.
Thank you.
note : i am newbie.I tried to make some research on matlab web but not luck.
Accepted Answer
More Answers (1)
KSSV
on 6 May 2021
Use:
FtempN =(1 + Alpha_pmp.* (AirTemp(1)-Tstc)) ;
1 Comment
Shahid Said
on 6 May 2021
Edited: Shahid Said
on 6 May 2021
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!