but I found remarkable your syntax on test case Nr. 27:
a = arrayfun(@(k) isPrimeSelf(n(k)),1:length(n));
if you use 'arrayfun' you can actually parse the vector directly and you can avoid parsing the indices. The following expression would be more narrow:
a = arrayfun(@isPrimeSelf,n)
Thanks for pointing that out. I've made the change.
Remove the small words from a list of words.
Project Euler: Problem 8, Find largest product in a large string of numbers
middleAsColumn: Return all but first and last element as a column vector
There are 10 types of people in the world
Identify Wagstaff primes
Compute the largest number possible with the Brussels choice
Convert a number from base 10 to factorial notation
Test the generalized Legendre conjecture
Compute a sum of Ramanujan
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