Warning: Colon operands should not be logical
2 views (last 30 days)
Show older comments
kkjnkjn
0 Comments
Answers (2)
Walter Roberson
on 11 Apr 2014
at least one of the entries k(novtrls).endingAdjFixNum is of logical data type instead of numeric.
find(cellfun(@islogical, {k.endingAdjFixNum}))
to see which ones
0 Comments
Image Analyst
on 11 Apr 2014
You forgot to put the error message so we know what line it's complaining about. Put this line before it bombs:
whos FixAdjEnd
k(novtrls).fixX
k(novtrls).fixY
k(novtrls).fixS
k(novtrls).fixE
and tell us what it says so that we have a better chance of helping you while doing this "blind" (i.e. with no data, small snippet of code that can't run, and no full error message).
2 Comments
Image Analyst
on 11 Apr 2014
Edited: Image Analyst
on 11 Apr 2014
See if this snippet helps:
structData.array = randi(9, [5,5]) % Define 2D array
structData.array % Report to command window.
structData.firstIndex = 2;
structData.lastIndex = 3
% Extract subarray
subArray = structData.array(:, structData.firstIndex : structData.lastIndex)
It shows how to extract a sub array out of an array where the array is one field of a structure, and the starting and ending columns are other members/fields of the structure.
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!