Reference to a cleared variable x

 Accepted Answer

Image Analyst
Image Analyst on 1 Oct 2017
Edited: Image Analyst on 30 Mar 2020
You used to have x, but now you don't anymore. You cleared it somehow, like by calling the clear() or delete() function. For example, if you have any lines like these inside your function, remove them:
clear all; % Remove this line from inside any function.
clearvars; % Remove this line from inside any function.
clear('x'); % If you have this in your function, remove it.
Can't say much more without seeing your code.

8 Comments

Adewale Obaro
Adewale Obaro on 16 Mar 2018
Moved: Stephen23 on 11 Aug 2023
To solve this problem, simply remove "clear all" from the function
Visweshwaran R
Visweshwaran R on 30 Mar 2020
Moved: Stephen23 on 11 Aug 2023
saved my day.Thanks
Ilham Apis
Ilham Apis on 26 Oct 2020
Moved: Stephen23 on 11 Aug 2023
Thanks
Marco Soto
Marco Soto on 17 May 2021
Moved: Stephen23 on 11 Aug 2023
Thanks
Ronald Zafra
Ronald Zafra on 18 Feb 2022
Moved: Stephen23 on 11 Aug 2023
Thanks
Sara
Sara on 13 Feb 2023
Moved: Stephen23 on 11 Aug 2023
Thanks
Luigi Frunzo
Luigi Frunzo on 17 May 2023
Moved: Stephen23 on 11 Aug 2023
Thanks! Thanks a lot I am becaming crazy!!!
Raúl Acuña
Raúl Acuña on 10 Aug 2023
Moved: Stephen23 on 11 Aug 2023
Thanks

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!