I don't know why matlab says my variable is undefined
Show older comments
blocks1 was a cell created by my script file used to split an image into blocks. However when I tried to use this in my function I got an error message saying the variable is undefined
1 Comment
Shalom D'souza
on 27 Nov 2017
Answers (1)
Walter Roberson
on 27 Nov 2017
2 votes
You did not pass blocks1 to your function, and you did not arrange to share the variable some other way. You should be passing it to the function.
3 Comments
KVM
on 27 Nov 2017
Exactly, you should pass blocks1 and blocks2. Also, I don,t see the point of passing n and m if you are defining these variables inside.
Simply change n,m in the arguments for blocks1 and blocks2: function [ SAVD ] = calculateSAVD(blocks1 ,blocks1 2,blockSizeX,blockSizeY)
Shalom D'souza
on 27 Nov 2017
Shalom D'souza
on 27 Nov 2017
Categories
Find more on Simulink Functions 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!