numerical integration dimension error
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
ok now Im getting another type of error
X = 0:1:100; Y = X.^(-1/2)*exp(-0.5*(0.00009996^2/X+34.3713^2*X)); Z =trapz(X,Y)
??? Error using ==> mldivide
Matrix dimensions must agree.
Whats wrong here? and how can I numerically integrate Y?
0 Commenti
Risposta accettata
Matt Fig
il 2 Mar 2011
You need a dot before every ^, * and / when working with vectors.
Y = X.^(-1/2).*exp(-0.5*(0.00009996^2./X+34.3713^2*X));
3 Commenti
Matt Fig
il 2 Mar 2011
You may not be expecting NAN, but that is how to make Y from X. Look at the exponent, it has values from -590 to -Inf. What do you think e^-590 is? ZERO (for all intents and purposes).
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Particle & Nuclear Physics in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!