Undefined operator / for input arguements of type cell.
Ältere Kommentare anzeigen
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 Kommentare
Anas Abou Allaban
am 11 Okt. 2015
dpb
am 11 Okt. 2015
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...
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Matrices and Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!