I need help to correct this code. How do I get this error corected (Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix.)?
Afficher commentaires plus anciens
function [SNRF, SNRUV] = SNG(noOfRuns)
NoOfPhotons = 1000000;
Q = 0.6;
b = 1;
E = 10000;
c = 0.00001;
stD = 1000;
Mean = 1000000;
for i = 1:noOfRuns
extPhotons = NoOfPhotons + randn(noOfRuns,1) * stD;
F = 0.01*extPhotons*2.303*E*b*c*Q;
stD2 = sqrt(F);
detPhotonsF = F + randn(noOfRuns,1)* stD2;
mean_detPhotonsF = mean(detPhotonsF);
stdev = std(detPhotonsF);
SNGF (i) = mean_detPhotonsF/stdev
end
2 commentaires
Bob Thompson
le 6 Fév 2019
What's wrong with it? Please provide more details, including a complete error message, if available.
Raymond Awoyemi
le 6 Fév 2019
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Electromechanical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!