Effacer les filtres
Effacer les filtres

E+ and Matlab Error - Error using table (line 335) 'XOutputNameX' is longer than the maximum allowed length for a table variable name.

2 vues (au cours des 30 derniers jours)
Hi everyone!,
I am trying to performe a co-simulation between E+ and Matlab using the "EnergyPlus Co-simulation Toolbox" and I tried to an output and the error bellow appears.
_______________________________________________________________________
Error using table (line 335)
'EP_ZN__Refrigeration_Air_Chiller_System_Total_Compressor_Electric_Energy'
is longer than the maximum allowed length for a
table variable name.
Error in mlepMatlab_example (line 41)
logTable = table('Size',[0, 1 + ep.nOut],...
________________________________________________________________________
This is line 41 :
nRows = ceil(endTime / ep.timestep); %Query timestep after mlep initialization
logTable = table('Size',[0, 1 + ep.nOut],...
'VariableTypes',repmat({'double'},1,1 + ep.nOut),...
'VariableNames',[{'Time'}; ep.outputSigName]);
iLog = 1;
How can I solve this problem ?

Réponses (1)

Steven Lord
Steven Lord le 30 Mar 2023
The maximum length a table variable name may have in MATLAB is namelengthmax.
namelengthmax
ans = 63
The name you're trying to use has length:
strlength('EP_ZN__Refrigeration_Air_Chiller_System_Total_Compressor_Electric_Energy')
ans = 72
You will need to use a shorter name, perhaps by abbreviating Refrigeration to Fridge and Electric to Elec?
strlength('EP_ZN__Fridge_Air_Chiller_System_Total_Compressor_Elec_Energy')
ans = 61
  1 commentaire
Zakaria OUAOUJA
Zakaria OUAOUJA le 31 Mar 2023
Modifié(e) : Zakaria OUAOUJA le 31 Mar 2023
Thank you @Steven Lord for your comment.
The output variable name is defined by EnergyPlus and I can not change it.
Is there any way to change it when imported to MATLAB.
% Prepare data logging
nRows = ceil(endTime / ep.timestep); %Query timestep after mlep initialization
% Logging Table
logTable = table('Size',[0, 1 + ep.nOut],...
'VariableTypes',repmat({'double'},1,1 + ep.nOut),...
'VariableNames',[{'Time'}; ep.outputSigName]);

Connectez-vous pour commenter.

Catégories

En savoir plus sur Tables dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by