Error in Loop in a loop
    3 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    liu James
 am 15 Dez. 2016
  
    
    
    
    
    Kommentiert: liu James
 am 15 Dez. 2016
            I'm getting this error
Cell contents reference from a non-cell array object.
Error in setParam (line 86)
          N{i}=((19*(TR{i}(t-1,1)))+TR{i}{t,1})/20;
After trying to run this for loop.
for i=1:length(TR)
    for t=length(TR{i})
      if t<21
          N{i}=mean(TR{i}(1:t,1));
      else
          N{i}=((19*(TR{i}(t-1,1)))+TR{i}{t,1})/20;
      end
    end
end
0 Kommentare
Akzeptierte Antwort
  KSSV
      
      
 am 15 Dez. 2016
        Try
N{i}=((19*(TR{i}(t-1,1)))+TR{i}(t,1))/20;
Instead of
N{i}=((19*(TR{i}(t-1,1)))+TR{i}{t,1})/20;
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!