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)
Show older comments
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!
1 Comment
Star Strider
on 4 Jun 2014
Is the error in the function or the main code?
What line is throwing the error? (Post the line. Don’t make us guess.)
Answers (0)
See Also
Categories
Find more on Clocks and Timers 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!