If statement for cells
9 次查看(过去 30 天)
显示 更早的评论
Hi, I have 3 different cell arrays like below - same size (let's call them A, B and C):
That I need to evaluate in an if statement in a for loop. But the final result gives me several empty numeric array in couple of the cells. The code is:
for i=1:4
for j=1:4
for k=1:10
for r=1:10
if ((abs(A{i,j}(k,r)))/(abs(C{i,j}(k,r)))<1) && ((abs(A{i,j}(k,r)))/(abs(B{i,j}(k,r)))<1)
A_num{i,j}{k,r}='Point is stable: Category 1 is assigned';
elseif ((abs(A{i,j}(k,r)))/(abs(C{i,j}(k,r)))>1) && ((abs(A{i,j}(k,r)))/(abs(B{i,j}(k,r)))>1)
A_num{i,j}{k,r}='Point is unstable';
end
end
end
end
end
For example, one of the cell array result is like bleow:
I checked all the components of the original cell arrays and none of them are zero or inf. Am I doing something wrong here?
0 个评论
采纳的回答
更多回答(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!