matrix dimensions wont agree when elements match/matlab -


I have a problem with the final calculation of my code, the very last part, where log is the natural log I RD = FAC. * Log (logs) (FACS) is needed to split Sigmaphack, or Robin = Segment / RD. My RD goes from 1 to 100, so why is my sigmaphake matrix dimension mismatch?

I want to divide the number of symphafe corresponding to the numbas of RD, all have the same dimension, so I do not know where the problem is coming from. I realize that RD (1) = - IF, is this causing the problem? And how do I fix it?

Code:

  n = 100; primlist = 2; Numba = 1: n; To start list of master number% if mod (2 + numba, primlist) ~ = 0 primlist = [primlist; 2 + numba]; % Priority number list expires end = fac = 1; % Factorials Start RD = 0; For numbas = 2: n% preallocating vectors later used prims = zeros (size (primlist)); pprims = void (size (primlist)); POW = prims; For I = 1: Length (primelist)% to identify each prime in the primal # 1: 10 if the mod (numbas, primlest (i). ^ K) == 0 primers (i) = primelest (i); The sum of all prime power units, such as Primus Newbes Power (i) = K; Primelist (I) & lt; = numbas pprims (i) = primlog (i); Primary end end exponents%% primes lower or equal numbas end end% Converting column vectors from line vector PPRIMS = pprims'; Prims = prims'; Pow = pove '; % Vector is making PLN (numbas, :) = PPRIMS; % Of the number of or less than the PPV number vector (numbas, :) = PRIMS; % Divider divider PV (numbas, :) = pow; For every number, the highest power of each prime RVE = Siemam (PVE); % exponents RVE (RE = ~ 0) = cummulative sum of REV (RE ~ 0 = 0); % Selects each non-zero element, then 1% adds factor priority = FAP * number; FACS (numbas) = ​​FAAC; % FACTORLES storage if facs == 1 RD == 1; % Log (logs (facs1))) Other does not exist RD = facs. * Logs (logs) (FACS); The end-end% divider divider NV = the setting of the amount of PLN. ^ REV-1; Participant Vector DV =% fraction of PLN-1; Separator NV (NV == 0) = 1; Getting rid of 0 for the product of% element is DV (DV == - 1) = 1; % elementwise product is getting rid of -1 for sigmafac = prod (NV, 2) ./prod (DV, 2); The sum of the divisors Robin = (sigmafac) ./ (RD)    

Your signature is < code> 100x1 but your RD 1x100 is causing the error if you want to work it out

  robin = (sigmafac) ./ (Rd)   

to

  Robin = (sigmapac) './ (RD)   

This sigmaphac 1x100 (transgus) and then your vectors will have the same dimension and you will be able to split.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -