Question
Using Matlab can you please write the code for question 5.

Display the zl and 22 results using the table function. 5. Create an anonymous function (name it perm) to determine how many
0 0
Add a comment Improve this question Transcribed image text
Answer #1

function p = perm( m, n )
% no of arrangement of subgroup of n possible form group size of m
% if order is important
% p = mPn
p = factorial(m)/factorial(m-n);

end

%script
clc
clear all

m = 10;
n = 3;

p = perm(m,n);

fprintf('\nat m =10 and n =3\nTotal no of arrangements = %i\n',p);

Command Window at m =10 and n =3 Total no of arrangements = 720

Add a comment
Know the answer?
Add Answer to:
Using Matlab can you please write the code for question 5. Display the zl and 22...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using Matlab. I can't seem to get the fprintf part to display the values in 2...

    Using Matlab. I can't seem to get the fprintf part to display the values in 2 columns. Could someone help me with that Before calculators were readily available (about 1974), students used tables to determine the values of mathematical functions like sine, cosine, and log. Create such a table for sine, using the following steps: • Create a vector of angle values from 0 to 27 in increments of T/10. • Calculate the sine of each of the angles, and...

  • Please use Matlab to solve and show your full codes Write a script file Ask the...

    Please use Matlab to solve and show your full codes Write a script file Ask the user to enter sides of a triangle: a, b, c Check to see if the sides are all greater than 0 If they are: Use the function (triangle) that you created in your last homework problem (HW#5 problemttF) to calculate the area. command Display the results on the screen using fprintf write the results to disk using the fprintf command. If any of the...

  • Please answer question on MATLAB showing work and the script. Thank you. Create a function M-ile...

    Please answer question on MATLAB showing work and the script. Thank you. Create a function M-ile that will implement a for loop to perform the tollowing tasks for a random input array, tt x. Count how many elements are greater than an arbitrary integer and display these values as well as the count using fprintf. loop to perform the following tasks Create a function M-ile that will implement a for l for a random input array, x. Calculate the arithmentic...

  • Please write the code using matlab 1) i. Create an anonymous function named optimist, that accepts...

    Please write the code using matlab 1) i. Create an anonymous function named optimist, that accepts a single variable as input i Create a row vector Tthat represents the number of seconds in two minutes, starting ii. Call the function optimist on the vector T, store the result in variable R1 and returns the double of that variable from one and ending at a hundred and twenty v. Create an anonymous function named pessimist, that accepts a single variable as...

  • DO THIS IN MATLAB PLEASE DO THIS IN MATLAB Create a script file that performs the...

    DO THIS IN MATLAB PLEASE DO THIS IN MATLAB Create a script file that performs the following calculations. Your script will use the functions you create. Label all graphs appropriately. For this project, do not have your homemade functions fprintf anything, instead have all your fprintf commands within your script. Attach your published script file along with .m files for your functions. Exercise 1. A fundamental iterative method for finding the roots of equations of one-variable is known as Newton's...

  • Please solve problem 4 and 5 using matlab and include the screenshot of the result ,...

    Please solve problem 4 and 5 using matlab and include the screenshot of the result , thank you Homework #8 Applied Programming, ENGR 10573 Spring 2018 Due Monday, Apr. 2 uploaded through TCU Online by 11:59 PM. Upload one script or function, named studentlastn ame-homework 8 ) n a single m- file that runs each problem. The homework problems should run sequentially showing I figure and or plots along with the proof that each problem works correctly. The single m-file...

  • photo of the code please and an explnation if possible, Construct a simple MATLAB function program...

    photo of the code please and an explnation if possible, Construct a simple MATLAB function program my_factorial which calculates product of first n positive integer numbers (i.e. find factorial n!). For full points: - Make sure you protect the code from illogical use (n must be positive integer) - Test the function by comparing with built in MATLAB function factorial(n) - Make sure you test your function for any limitations. O marks) -3. Using my factorial function from the previous...

  • Please use matlab, post the code, and dont just write the code by hand. Thank you!...

    Please use matlab, post the code, and dont just write the code by hand. Thank you! 4 [3 points] Use the function f(x on the interval [5, 5] and the 11 points below to find a N-10 Lagrange polynomial, using MATLAB. You will need to write code for and plot the polynomial as a function of x, but you do not have to write the polynomials down by hand 5 0 2 3 4 5 f(x) | 0.0399 | 00623...

  • Matlab Question. Please be detailed Write a user-defined function that performs LU decomposition (using Gauss Elimination...

    Matlab Question. Please be detailed Write a user-defined function that performs LU decomposition (using Gauss Elimination without partial pivoting) of a square matrix. Do not use built-in MATLAB functions lu( ), inv(), \, linsolve(). Matrices (in [A]*{x}={B} form) A=[15 -3 -1; -3 15 -6; -4 -1 12] B=[3800; 1200; 2350] Given code lines: function[L,U]=myLUFact_username(A) [m,n]=size(A); %numbers of rows/comlumns of A assert(m==n, 'A should be a square matrix');

  • For this In-Class Exercise, you are asked to build a MATLAB code that makes a few...

    For this In-Class Exercise, you are asked to build a MATLAB code that makes a few assignment statements and a logical test with random numbers. To answer this ICE, you will need to upload a screenshot of your successful run showing ALL of the outputs. Remember to use good programing skills for the code. For your outputs: If your output for a step below is a single value, use a command similar to:fprintf(‘Question 5 answer: %4.3f \n,A) or fprintf(‘Question 5...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT