Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using Matlab please help me with this The binomial coefficient (nk) (read n choose k) is defined as (nk)=(nk)!k!n! where ! is the factorial
using Matlab please help me with this
The binomial coefficient (nk) (read " n choose k") is defined as (nk)=(nk)!k!n! where ! is the factorial symbol, e.g., 4!=4321=24) and n and k are nonnegative integers with n>k. (1) Write a function call mybinomial.m that calculates n choose k without using MATLAB's built-in factorial function. This will involve multiple loops. Your script should include if-statements that return an error if n is less thatn k OR if either n or k is negative. You can assume that the user will use integers for n and k. (2) Test you function with the following inputs n=10,k=2,n=5,k=3n=9,k=13 HW GUIDELINES - Submit your m-files and a diary file containing successful execution of the code (using the tests given in the problem). Make sure that the diary is a .txt file and do not compress the file(s). - Put your name and lastname on the fist line of the code. If you work with your classmate(s), put their name(s) on the second line. - Remember that m-files should be commented so that a reader would know what the program/function does. - Remember to suppress output and only show output where appropriate in the diary fileStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started