1

I'm trying to execute a script in MATLAB that uses a tilde. However, earlier versions of MATLAB doesn't support the tilde. How can I substitute for the tilde?

Here is the code:

                fname = 'worldmap.png';
                img = imread(fname);
                [imgH,imgW,~] = size(img);

2 Answers 2

2

Just use a dummy variable in place of the tilde when it is not supported in your version

 [imgH, imgW, dummy_variable] = size(img);
1
  • Thanks a lot. I forgot about the dummy variable.
    – Minimalist
    Sep 11, 2012 at 21:59
2

The de-facto dump variable in older versions of matlab is 'ans', as it gets overwritten all the time anyway.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.