How to give Cell of an Cell Array as input for a function so that i can use them in the function?

1 view (last 30 days)
this is the function:
function X = long(x1,x2,B2{i,13},B2{i,14})
if (B2{i,13}<x1 && B2{i,14}<x1) X=1; elseif(B2{i,13}>x2 && B2{i,14}>x2) X=2; elseif(B2{i,13}>=x1 && B2{i,14}<=x2) X=3; elseif(B2{i,13}<x1 && B2{i,14}>=x1 && B2{i,14}<=x2) X=4; elseif(B2{i,13}>=x1 && B2{i,13}<=x2 && B2{i,14}>x2) X=5; end end
B2 is a cell array containing both strings and numbers(but here x1,x2,B2{i,13},B2{i,14} are numbers.) While running the main code it is showing the error:"Unbalanced or unexpected parenthesis or bracket.". How can i use the B2 array values for comparision in the function? thanks in advance!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!