Parse error when trying to change a text in app designer
Show older comments
Hi,
In app designer for some specific dropdown value, I want some other text to change. I want them to be differrent than starting values only for a distinct dropdown value so I thought it would be better to use while instead of if. However I am getting parse error at the line where I define the condition. My code is:
methods (Access = private)
function updatePlot(app)
app.CompleteLamp.Color = [0.5 0.5 0.5] ;
while app.TypeDropDown.Value = 'normalnontruncated'
app.HumanCapitalUpperLimitEditFieldLabel.Text='Mean'
app.HumanCapitalUpperLimitEditFieldLabel.Text='Standard Deviation'
end
if app.SigmaSlider.Value>0.99/app.AlphaSlider.Value
app.SigmaSlider.Value=0.99/app.AlphaSlider.Value;
end
if app.AlphaSlider.Value>0.99/app.SigmaSlider.Value
app.AlphaSlider.Value=0.99/app.SigmaSlider.Value;
end
sigma = app.SigmaSlider.Value ;
tau = app.TaxRateSlider.Value ;
alpha = app.AlphaSlider.Value ;
hu=generateH(app);
lenh=length(hu);
[ku,ela]=genInv(app);
pubshare=sum(ku==0)/lenh;
plot(app.PulsePlotUIAxes, hu, ku);
xlabel(app.PulsePlotUIAxes,'Individuals');
ylabel(app.PulsePlotUIAxes,'Investment');
tegzt={sprintf('Investment level alpha=%.2f, sigma=%.2f and TaxRate=%.2f', alpha, sigma, tau)};
title(app.PulsePlotUIAxes,tegzt,'FontSize',14);
app.ps.Value = round(pubshare,3);
app.elas.Value={sprintf('Human capital elasticity is %.2f',ela)};
app.CompleteLamp.Color = [0 1 0] ;
end
end
At the line where I use 'while' I get the error : "Parse error at '=': usage might be invalid MATLAB syntax"
Thank you
Accepted Answer
More Answers (0)
Categories
Find more on App Building 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!