Search code examples
matlabsubstitutiontilde

Substitue for the Tilde in MATLAB


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);

Solution

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

     [imgH, imgW, dummy_variable] = size(img);