Clear Filters
Clear Filters

Dot indexing is not supported for variables of this type.

5 views (last 30 days)
I get this error while running the code.
Dot indexing is not supported for variables of this type.
Error in Fun_Objective (line 23)
Conv = Aspen.Tree.FindNode("\Data\Results Summary\Run-Status\Output\PER_ERROR").Value; %Convergence
I am getting an error suddenly after certain interations ( sometimes 1/5/20 iterations) that dot indexing not supported in the statement above. When I go and check the aspen file it just shows required input complete, but does not run. At the start I have reinit the code and I do run the engine, but it still shows required input complete, and the simulation does not run. Does anyone face a similar problem like this?

Accepted Answer

Walter Roberson
Walter Roberson on 29 Sep 2024
Change
Conv = Aspen.Tree.FindNode("\Data\Results Summary\Run-Status\Output\PER_ERROR").Value; %Convergence
to
ConvNode = Aspen.Tree.FindNode("\Data\Results Summary\Run-Status\Output\PER_ERROR");
if isempty(ConvNode)
error('failed to find PER_ERROR node');
else
Conv = ConvNode.Value; %Convergence
end
  5 Comments
Walter Roberson
Walter Roberson on 30 Sep 2024
Conv = nan;
for retry_count = 1 : 10
ConvNode = Aspen.Tree.FindNode("\Data\Results Summary\Run-Status\Output\PER_ERROR");
if ~isempty(ConvNode)
Conv = ConvNode.Value;
break
end
end
You can retry the FindNode. I suspect, however, that the process may be stuck, and it might be necessary to close down the connection and open it again.

Sign in to comment.

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!