Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

Prime Letters = Removing | MATLAB

Code:

function y = primeLetters(x)
  y = double(x);
  z=[];
  temp=0;
  for i=1:length(x)
      t=x(i);
      for j=2:t/2
          if(rem(x(i),j)==0)
              temp=temp+1;
          end
      end
          if(temp~=0)
              z=[z t];
          end
          temp=0;
  end
y=char(z);

end

No comments

Popular Posts

Followers