Question

1. Write a code to calculate nas a function of ga, when NA l300, 600, 3000, 6000, NB (200, 400, 2000, 4000), and g 100, plot them and try to find some tendency when N increases (hint: 4 plots). 2. Write a code to calculate the probability of S2(ga), when Na 1200, 300, NB (2000, 3000), for gr (100, 1000), plot them and try to explain the differences. (hint: 2 plots)
Can someone help me figure out how to write code on Matlab for either of these two questions? My biggest problem is working with the large factorials which Matlab can't seem to handle
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Us the following function to compute the factorials of very large numbers.

function [m,e] = mylargefact(n)

f = gammaln(N+1)/log(10);
e = floor(f);
m = 10.^(f-e);

The following method also work for large factorials

syms n
subs(n*factorial(n-1),1000)
Add a comment
Know the answer?
Add Answer to:
Can someone help me figure out how to write code on Matlab for either of these...
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
  • Read the sample Matlab code euler.m. Use either this code, or write your own code, to solve first...

    Read the sample Matlab code euler.m. Use either this code, or write your own code, to solve first order ODE = f(t,y) dt (a). Consider the autonomous system Use Euler's method to solve the above equation. Try different initial values, plot the graphs, describe the behavior of the solutions, and explain why. You need to find the equilibrium solutions and classify them. (b). Numerically solve the non-autonomous system dy = cost Try different initial values, plot the graphs, describe the...

  • Can someone help me out with this. I can't get my MATLAB to do these correctly,...

    Can someone help me out with this. I can't get my MATLAB to do these correctly, thanks! Solve the following differential equations using the Matlab function "ode45”, ”ode23” or “ode 15s". For all cases use odeset to set the stats to on, so you can see the process for the solver. Plot your result. Use a legend on your plots. (a) y' =-2y y(0) = 5, tfinal = 2 (b) y" + 3 y' + 25 y = 0 y(0)...

  • Please help me write a code for this in Matlab T = 1 millisecond Vm =...

    Please help me write a code for this in Matlab T = 1 millisecond Vm = 1 volt (amplitude voltage) t = linspace(-T, 2*T, 3001) The following pararameter is given v(t) = Vm - (Vm/T)t for 0<= t <= T 0 elsewhere I need to modify the vector v so that is represents a periodic function with a period T over this time period (hint: it should look like a sawtooth), and plot v vs t over the range from...

  • can you write a matlab code PROJECT DELIVERABLE 1: In Project Deliverable 1, you will write...

    can you write a matlab code PROJECT DELIVERABLE 1: In Project Deliverable 1, you will write a Matlab code to automatically run your Simulink model where two parameters change, and save the performance index. Finally, youu plot the corresponding performance index as a 3D plot. Step 1) Build the following system in Simulink and name it as "FirstOrderSystem_ProjectGroupnumber.mdl". Finrderte Diegram S dion oulo Ro Cede Helps Md re Prrd K sebr Stro Transter Ecn gdet 100% Ready In this system,...

  • Can someone please help me with this, I'm really stuck. here a sample code provide for the matlab...

    can someone please help me with this, I'm really stuck. here a sample code provide for the matlab: clear all; close all; % ---------- (a) ---------- a = 0.7; % attenuation coef. D = 5; % digital time delay UnitImpulse = [1 zeros(1,???)]; % creat unit impulse, starting from n=0; x = UnitImpulse; y = filter(1, [1 zeros(1, D-1) -a], x); % help filter, do you know the usage of filter() now? n = 0:(length(y)-1); % check length of y[n]...

  • This is a matlab HW that I need the code for, if someone could help me figure this out it would b...

    This is a matlab HW that I need the code for, if someone could help me figure this out it would be appreciated. The value of t can be estimated from the following equation: in your script file, estimate the value of π for any number of terms. You must ask the user for the desired number of terms and calculate the absolute error/difference between your calculation and the built-in MATLAB value ofpi. Display your results with the following message...

  • CAN SOMEONE PLEASE HELP ME WRITE THIS CODE IN C++, PLEASE HAVE COMMENTS IN THE CODE...

    CAN SOMEONE PLEASE HELP ME WRITE THIS CODE IN C++, PLEASE HAVE COMMENTS IN THE CODE IF POSSIBLE!! General Description: Write a program that allows the user to enter data on their friends list. The list holds a maximum of 10 friends, but may have fewer. Each friend has a name, phone number, and email address. The program first asks the user to enter the number of friends (1-10). You are not required to validate the entry, but you may...

  • Can someone help me figure out this unknown compound? It should be an alcohol C-H Analysis...

    Can someone help me figure out this unknown compound? It should be an alcohol C-H Analysis %C=84.75 %H=6.57 Melting Point (°C) 66 Boiling Point (°C) 298 TLC (R) n/a Carbon NMR of unknown #68 Common Name: 13C NMR WPCName Zoom Out CAS No: Solvent: BP: MP: 1.00 0.90 0.80 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 40 130 110 100 IR Spectrum for unknown #68 BP: FTIR Common Name: IUPAC Name: MP MICRONS 22 23 24 25 26 272.12.07...

  • PART C PLEASE!!! IF YOU KNOW HOW TO CODE MATLAB PLEASE HELP THANK YOU Write a Matlab/Python scrip...

    PART C PLEASE!!! IF YOU KNOW HOW TO CODE MATLAB PLEASE HELP THANK YOU Write a Matlab/Python script which computes the trajectory of P according to the system of equations (1) and the corresponding (non-dimensional) range for given values of (α,φ,0), varying values of φ 0 Plot the trajectories for 6 values of φ 0 of your choice in the interval 0< φ0 π/2. Compute the corresponding range reached by each trajectory. Note: Special attention will be given to the...

  • Can someone upload a picture of the code in matlab Write a "Guess My Number Game"...

    Can someone upload a picture of the code in matlab Write a "Guess My Number Game" program. The program generates a random integer in a specified range, and the user (the player) has to guess the number. The program allows the use to play as many times as he/she would like; at the conclusion of each game, the program asks whether the player wants to play again The basic algorithm is: 1. The program starts by printing instructions on the...

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