MATLAB: App Designer Plot having error

app designerMATLABplot

I tring to plot image to UIAxes
Error is 'reference to a cleared variable app.
Error in app1 (line 271)
runStartupFcn(app, @startupFcn)'

Best Answer

  • It stated an error "Error is 'reference to a cleared variable app."
    Don't use clear all, neither clc in this and most of the cases.
    if you call a function with input arguments, and within that function you execute clear all command, you are not able to use anything you sent, maybe even what's declared prior to entering the function.