Unrecognized function or variable
107 views (last 30 days)
range = 1;
t = -range:0.01:range;
w = 1;
P = unit(t+w/2)-unit(t-w/2);
axis([-range-1 range+1 0 1])
line([0 0],ylim,'color','r', 'Linewidth',2)
line(xlim,[0 0],'color','r', 'Linewidth',2)
The error I get is as follows. I don't know how to fix this problem. Thank you in advance for your help.
the cyclist on 15 Mar 2021
To my knowledge, there it no MATLAB function named unit().
I also used the search bar in the documentation, and did not find anything.
Where did you get this code? Maybe you are missing a second file, that has a user-defined function with that name?
Image Analyst on 15 Mar 2021
Why did you think it knows what unit is? It does not.
If, by chance, you want to convert to integer use uint32() instead of unit(). Be careful of the location of the "i" and the "n".
Ronielson LIma on 2 Nov 2021
Can you help me please.
Unrecognized function or variable 'distinguishable_colors'.
Error in drawPR (line 8)
methods_colors = distinguishable_colors(length(methods));