Subscript indices must either be real positive integers or logicals.
    2 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    Yashika
 le 12 Oct 2018
  
    
    
    
    
    Réponse apportée : Image Analyst
      
      
 le 12 Oct 2018
            I was trying to code modified euler cauchy method for solving ODE-IVP. I am getting the following error,
Subscript indices must either be real positive integers or logicals.
When I removes 0.5*h_int from the 4th equation, this error gets solved. How to fix this? I need to implement same algorithm.
for n=1:N_samples-1 x_tilde=cauchy(:,n)+(h_int/2)*my_fun(time(n),cauchy(:,n)); cauchy(:,n+1)=cauchy(:,n)+h_int*my_fun(time(n+0.5*h_int),x_tilde); X0=cauchy(:,n+1); end
0 commentaires
Réponse acceptée
  Image Analyst
      
      
 le 12 Oct 2018
        It's throughly explained in the FAQ: https://matlab.wikia.com/wiki/FAQ#How_do_I_fix_the_error_.22Subscript_indices_must_either_be_real_positive_integers_or_logicals..22.3F
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

