Stackedplot error when changing position and plotting again
Hello together,
I get an error with stackedplot, when changing position (which works always the first time) and plotting then again, adding new variables. Without the position change, there is no error and I can plot on.
That’s the code I use. Without the "Position" line it works fine all the time. With the position change I get an error (below code).
app.Logs(app.Log).Stack{1} = stackedplot(app.Logs(app.Log).Table, app.Logs(app.Log).ToPlot,’Parent’,app.StackedTab);
for e=1:+1:height(app.Logs(app.Log).Stack{1}.DisplayLabels)
emptyLabels(e,1) = ""; % Create empty string for label
end
if app.Logs(app.Log).Plots > 0
app.Logs(app.Log).Stack{1}.DisplayLabels = emptyLabels; % "Delete labels"
app.Logs(app.Log).Stack{1}.Position = [0.05,0.05,0.90,0.90]; % Get rid of the broad margin
end
Thats the error:
Error using stackedplot (line 100)
Brace indexing is not supported for variables of this type.
Error in LogReader/DataButtonPress (line 141)
app.Logs(app.Log).Stack{1} =
stackedplot(app.Logs(app.Log).Table,
app.Logs(app.Log).ToPlot,’Parent’,app.StackedTab);
Error in LogReader>@(varargin)app.DataButtonPress(varargin{:}) (line 336)
app.Logs(app.Log).Variables{2, i}.ValueChangedFcn =
@app.DataButtonPress; %Callback function
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 429)
Error while evaluating StateButton PrivateValueChangedFcn.
What am I not understanding? ^^
Thanks in advance!
ChristofHello together,
I get an error with stackedplot, when changing position (which works always the first time) and plotting then again, adding new variables. Without the position change, there is no error and I can plot on.
That’s the code I use. Without the "Position" line it works fine all the time. With the position change I get an error (below code).
app.Logs(app.Log).Stack{1} = stackedplot(app.Logs(app.Log).Table, app.Logs(app.Log).ToPlot,’Parent’,app.StackedTab);
for e=1:+1:height(app.Logs(app.Log).Stack{1}.DisplayLabels)
emptyLabels(e,1) = ""; % Create empty string for label
end
if app.Logs(app.Log).Plots > 0
app.Logs(app.Log).Stack{1}.DisplayLabels = emptyLabels; % "Delete labels"
app.Logs(app.Log).Stack{1}.Position = [0.05,0.05,0.90,0.90]; % Get rid of the broad margin
end
Thats the error:
Error using stackedplot (line 100)
Brace indexing is not supported for variables of this type.
Error in LogReader/DataButtonPress (line 141)
app.Logs(app.Log).Stack{1} =
stackedplot(app.Logs(app.Log).Table,
app.Logs(app.Log).ToPlot,’Parent’,app.StackedTab);
Error in LogReader>@(varargin)app.DataButtonPress(varargin{:}) (line 336)
app.Logs(app.Log).Variables{2, i}.ValueChangedFcn =
@app.DataButtonPress; %Callback function
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 429)
Error while evaluating StateButton PrivateValueChangedFcn.
What am I not understanding? ^^
Thanks in advance!
Christof Hello together,
I get an error with stackedplot, when changing position (which works always the first time) and plotting then again, adding new variables. Without the position change, there is no error and I can plot on.
That’s the code I use. Without the "Position" line it works fine all the time. With the position change I get an error (below code).
app.Logs(app.Log).Stack{1} = stackedplot(app.Logs(app.Log).Table, app.Logs(app.Log).ToPlot,’Parent’,app.StackedTab);
for e=1:+1:height(app.Logs(app.Log).Stack{1}.DisplayLabels)
emptyLabels(e,1) = ""; % Create empty string for label
end
if app.Logs(app.Log).Plots > 0
app.Logs(app.Log).Stack{1}.DisplayLabels = emptyLabels; % "Delete labels"
app.Logs(app.Log).Stack{1}.Position = [0.05,0.05,0.90,0.90]; % Get rid of the broad margin
end
Thats the error:
Error using stackedplot (line 100)
Brace indexing is not supported for variables of this type.
Error in LogReader/DataButtonPress (line 141)
app.Logs(app.Log).Stack{1} =
stackedplot(app.Logs(app.Log).Table,
app.Logs(app.Log).ToPlot,’Parent’,app.StackedTab);
Error in LogReader>@(varargin)app.DataButtonPress(varargin{:}) (line 336)
app.Logs(app.Log).Variables{2, i}.ValueChangedFcn =
@app.DataButtonPress; %Callback function
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 429)
Error while evaluating StateButton PrivateValueChangedFcn.
What am I not understanding? ^^
Thanks in advance!
Christof stackedplot position MATLAB Answers — New Questions