from this code:
if onlineoffline == 'online'
msgbox('onlinemode')
break, end
end
if onlineoffline == 'online' everything works fine,
but when it is not true this error appears.
what i want to reach is that the callback stops
if onlineoffline == 'online' and if not, just go on,
whtas wrong ?
thanks for help,
Try to execute this from the command line:
onlineoffline = 'offlin';
onlineoffline == 'online'
== compares character by character and only works if the strings have
equal length (just for normal vectors/arrays).
Use strcmp for string comparisons:
if strcmp(onlineoffline, 'online')
% bla bla bla
end
Lars
Lars Gregersen
www.rndee.dk
l...@rndee.dk
*snip*
> Try to execute this from the command line:
> onlineoffline = 'offlin';
> onlineoffline == 'online'
>
> == compares character by character and only works if the strings have
> equal length (just for normal vectors/arrays).
>
> Use strcmp for string comparisons:
> if strcmp(onlineoffline, 'online')
> % bla bla bla
> end
For general comparisons of arrays, use ISEQUAL:
ISEQUAL True if arrays are numerically equal.
ISEQUAL(A,B) is 1 if the two arrays are the same size
and contain the same values, and 0 otherwise.
ISEQUAL(A,B,C,...) is 1 if all the input arguments are
numerically equal.
ISEQUAL recursively compares the contents of cell arrays and
structures. If all the elements of a cell array or structure
are numerically equal, ISEQUAL will return 1.
--
Steve Lord
sl...@mathworks.com
A string is a matrix. A == B compares each element of A with each
element of B, and returns a third matrix C the same size as A and B,
where C(i) = 1 if A(i)==B(i).
If A and B are different sizes, this doesn't work, thus the error.
Bottom line, use strcmp for comparing strings. (help strcmp)
--
Peter Boettcher <boet...@ll.mit.edu>
MIT Lincoln Laboratory
MATLAB FAQ: http://www.mit.edu/~pwb/cssm/
I downloaded this source code to embed in my project but it gives this error(Array dimensions must match for binary array op.) while running. Please suggest a solution to the same.