Index exceeds the number of array elements (0)
458 次查看(过去 30 天)
显示 更早的评论
I am receiving the appended error (untitled.jpg) when I run the code in the loop which is appended as a jpg (loop where error occurs.jpg). I am also attaching the plot permeability file for reference.
4 个评论
RAJESH
2024-3-7
clc; clear all;
%define u
%define v
%L_i(x)=a_i(x)+b_i
format 'bank'
x=[1/4 1/2]
n=2;
for i=1:n
a(i)=x(i+1)-x(i)/0.5
end
why am i getting index exceed the number of arrays
回答(1 个)
Cris LaPierre
2022-6-14
The error means you are trying to index an empty array.
a = [];
a(1)
It looks like the line causing the error is from ChomboOutput
obj.levelArray(1)
You'll want to check that levelArray has been assigned values before indexing into it.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!