フィルターのクリア

Index exceeds the number of array elements (0).

1 回表示 (過去 30 日間)
Mohammad Dabbagh
Mohammad Dabbagh 2021 年 5 月 4 日
編集済み: Mohammad Dabbagh 2021 年 5 月 5 日
Hi all,
I was wondering if anyone could assist me with a quick question.
Actually, I'm trying to read two columns of a csv file (xlsread), find the absolute differnce between those two columns per row (called as temp_violation), and then add finally, sum it with another column and store it as Qsystem_total_cool, as follow:
Cooling_column = xlsread('eplusout.csv','eplusout','U290:U313');
zone_air_temp = xlsread('eplusout.csv','eplusout','Z290:Z313');
setpoint_temp = xlsread('eplusout.csv','eplusout','I290:I313');
alpha= 1000;
beta = 2;
temp_violation = sum(abs(zone_air_temp(296:310) - setpoint_temp(296:310)));
Qsystem_total_cool= sum(Cooling_column + alpha * (temp_violation)^beta);
However, it shows me an error on the line starts with temp_viloation: Index exceeds the number of array elements (0).
Any ideas and help would be greatly appreciated.
Thanks!
  1 件のコメント
Mohammad Dabbagh
Mohammad Dabbagh 2021 年 5 月 4 日
編集済み: Mohammad Dabbagh 2021 年 5 月 4 日
@Walter Roberson special thanks!

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2021 年 5 月 4 日
data = readtable('eplusout.csv', 'readvariablenames', false);
Cooling_column = data{290:313,21};
zone_air_temp = data{290:313,26};
setpoint_temp = data{290:313,9};
alpha = 1000;
beta = 2;
temp_violation = sum(abs(zone_air_temp - setpoint_temp));
Qsystem_total_cool= sum(Cooling_column + alpha * (temp_violation).^beta);
  1 件のコメント
Mohammad Dabbagh
Mohammad Dabbagh 2021 年 5 月 4 日
編集済み: Mohammad Dabbagh 2021 年 5 月 5 日
Thank you so much Walter! You’re absolutely wonderful!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by