Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

if ispc && isequal(get(hObject,'BackgroundColor')
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
get(0,'defaultUicontrolBackgroundColor'));
set(hObject,'BackgroundColor','white');
end

 Accepted Answer

When you open a door, you must then close it, else MATLAB will not be happy. Look carefully at the line in question. After all, MATLAB flagged it.
if ispc && isequal(get(hObject,'BackgroundColor')
Count the number of open parens. I see TWO of them.
Next, count the number of close parens. I see only ONE.
Finally, re-read the error message.

More Answers (0)

Categories

Find more on Function Creation in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!