Error message "Unable to resolve the name coder.target." when trying to use the downsample function
3 views (last 30 days)
after I installed Matlab R2021b (used R2018b before) I can't use the downsample function anymore.
If, for example, I try to run code like this:
example_dataset = [0 1 2 3 4 5 6 7 8 9 10 11];
example_reduced_dataset = downsample(example_dataset,2);
I get the following error messages, which I can't really interpret:
Unable to resolve the name coder.target.
Error in downsample (line 42)
isMATLAB = coder.target('MATLAB');
Error in untitled (line 2)
example_reduced_dataset = downsample(example_dataset,4);
Can anyone help me with this issue? Obviously I can work around and write my own function for downsampling input data but I would prefer making the downsample function usable again.
The problem only occurs with this specific function, anything else works properly after switching to the newer MATLAB version.
Prasanna Konyala on 16 Feb 2022
It works fine on my end, so I think the error is an installation issue. This type of issue can occur when the specified function is not on MATLAB search path. You could try the following troubleshooting steps:
Take a backup of your 'pathdef.m' file, which can be located by using the command:
>> which -all pathdef
Before proceeding, ensure that you make a safe copy of the file by copying it to a folder outside of your MATLAB path.
After taking the backup, please execute the following commands in the MATLAB Command Window to restore the default MATLAB search path:
>> rehash toolboxcache
After this step, please use MATLAB to see if the issue occurs again. If the issue is resolved, then you may want to save the new MATLAB search path by executing the following command: