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

 Akzeptierte Antwort

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.

Weitere Antworten (0)

Kategorien

Mehr zu Function Creation finden Sie in Hilfe-Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by