1

I have the variable delta in the main and the line: Y_Q = blkproc(Y_dct, [8 8], @Quantization);

I need the function Quantization to know about the variable delta.

Can someone please help me? thanks..

0

1 Answer 1

2

If Quantization is a subfunction, it will be able to access variables in the outer function (you can also introduce a subfunction that calls Quantization with the callback arguments and any additional values you need).

Another method is to make your shared variable global, using the global statement at the top of each function that should share it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.