Error Operands to the || and && operators must be convertible to logical scalar values.
Show older comments
Names = {'RHip','RKnee','RAnkle'};
Why doing this works ok
if~isempty( strfind(Names{1}, 'Hip') || strfind(Names{2}, 'Knee'))
if~isempty( strfind(Names{1}, 'Hip') || strfind(Names{3}, 'Knee'))
but doing this gives the error Operands to the || and && operators must be convertible to logical scalar values.
if~isempty( strfind(Names{3}, 'Hip') || strfind(Names{2}, 'Knee'))
Note in code was missing the ~isempty (i already added it). Nevertheless this dont change the outcome. The problem is that when the first operation give an [ ] the outcome is an error
Accepted Answer
More Answers (1)
Armindo
on 7 Feb 2019
0 votes
1 Comment
KALYAN ACHARJYA
on 7 Feb 2019
Edited: KALYAN ACHARJYA
on 7 Feb 2019
Please read the explanation form @Walter sir
Categories
Find more on Creating and Concatenating Matrices 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!