Loop to a specific point in data set
이전 댓글 표시
I have a function used to loop through a data set and I want it to stop once the data reaches a specific threshold (In this case, the failure displacement value 'fdValue'. However, I keep getting the error for the if statement:
Undefined function 'ge' for input arguments of type 'cell'.
I think 'cellfun' can be used in this case but I'm not sure how to use it. Any Suggestions? Below is the function
totalRect = 0;
for j = 2:length(bridgeDisp)
%Calculations
rectangle1 = (bridgeDisp(j, 1) - bridgeDisp(j-1, 1))*((bridgeLoad(j, 1) + bridgeLoad(j-1, 1))/2);
totalRect = totalRect + rectangle1;
%If statment error
if bridgeDisp(j, 1) >= fdValue
break;
end
end
댓글 수: 4
per isakson
2015년 10월 13일
What does
whos fdValue
show?
Guillaume
2015년 10월 13일
I think it's clear that fdValue is a cell array since it can't be bridgeDisp (otherwise the error would be on the rectangle1 line).
Why is fdValue a cell array? Can we see how fdValue is created?
Anas Abou Allaban
2015년 10월 13일
편집: Anas Abou Allaban
2015년 10월 13일
Anas Abou Allaban
2015년 10월 13일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!