With my function and R2015B, it works so I don't understand:
function y = isPernicious(x)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
if(x == 1)
y = true;
if(mod(x,2) == 0)
y = false;
y = true; % PRIME
if(mod(x,k) == 0)
y = false; % NOT PRIME
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office