the last assertion is wrong
Oops, I guess I commented in the solution, not the problem. (What's the difference????) They should check if their answer is symmetrical, which it isn't, so their solution must be wrong regardless of subsequent values
I've removed the last assertion and rescored. Thanks for the note.
a nice one-liner, again
Easy, but I enjoyed it nevertheless.
Used expm but the numbers didn't equal until I wrapped with int16.
Size is 26. How do you get any less?
"y = arrayfun(@nchoosek, repmat(n, 1, n + 1), 0:n)" gives a score of 23
Why won't syms work? I can run this in MATLAB and it outputs the correct pascal line given n.
We used a subfunction Cpn(n,p)
Y=factorial(p)/(factorial(n)*factorial(p-n)) instead of the function "nchoosek" .
When I submitted the solution "y=round((2^n)*binopdf(0:n,n,0.5));" cody test aborted by saying "binopdf" is an undefined function. Strange !!
binopdf is part of the statistics toolbox, not core Matlab.
How about an assertion on whether or not the sides are symmetric?
This problem's last assertion is wrong :/
At first I thought it was an issue with accuracy on my end ...
Energy of a photon
Is this matrix orthogonal?
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
Matlab Basics - y as a function of x
Find the two most distant points
Connect Four Win Checker
Find all elements less than 0 or greater than 10 and replace them with NaN
Make the vector [1 2 3 4 5 6 7 8 9 10]
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