Index exceeds matrix dimensions
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
Hello,
I keep getting this error for one of matrices that is in an if loop. I checked the size of the matrix and it is the same size as the for loop limits that the if loop is called in, so I can't figure out how it's trying to access an index that's greater than the size of the matrix.
In the code below the error is happening at the line that calls Rs_Rc(ii,kk) in the if loop, but I've doubled checked and the size of that matrix is the same as the for loop limits. Even the size of the Rc and Rs matrices used to compute Rs_Rc are the same. Please help!
for ii = 1:Z-1
for kk = 1:(N_ofRibs-1)*5
Rc(ii,kk) = sigma_panelbending(ii,kk)/compression_crit(ii,kk);
Rs(ii,kk) = tau_panelshear(ii,kk)/tau_crit(ii,kk);
Rs_Rc(ii,kk) = Rs(ii,kk)^1.5 + Rc(ii,kk);
if Rc(ii,kk) <= 1 && Rs(ii,kk) <= 1 && ...
Rs_frontspar(1,kk) <= 1 && Rb_frontspar(1,kk) <=1
if Rs_Rc(ii,kk) <= 1 && Rb_Rs_frontspar(1,kk)...
&& Rb_Rs_rearspar(1,kk)
if stringer_failure <= 1
Thanks!
Antworten (1)
per isakson
am 7 Jun. 2012
Set
dbstop if error
run and inspect the variables carefully
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!