Undefined operator / for input arguements of type cell.
이전 댓글 표시
I realize this question may have been asked a billion times, but I can't for the life of me see why its popping up with my code. I'm calculating the maximum value in a data set 'bridge1Load' through this loop:
maxLoad1 = 0;
for n = 1:length(bridge1Load)
for k = 1
if bridge1Load(n, k) > maxLoad1
maxLoad1 = bridge1Load(n, k);
end
end
end
and my bridge weight is a user input from:
bridge1WeightInput = inputdlg('Please enter the weight of bridge #1','Bridge #1 Weight');
I'm trying to calculate the strength to weight ratio via:
s2wRatio1 = maxLoad1 / bridge1Weight;
but I keep getting the error stated above.
댓글 수: 2
Anas Abou Allaban
2015년 10월 11일
dpb
2015년 10월 11일
bridge1Load must be a cell array, not a double, then. A likely candidate to have caused that would be reading the data from a file via textscan.
The best solution relies somewhat on just what the form of the data are; how was it actually loaded/obtained and specifically, what does
whos bridge1Load
return?
Then we can look at "more better" ways to do the above as well...
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!