Error using input,,, Undefined function or variable 'friend'.

I've just started using Matlab, I previously got this to work, but for some reason I can't figure out why it's not working any more. Anyway, it's just a mess around.
question = input('say friend and enter');
str = 'correct';
message = [str];
if (quesition ~= friend);
disp(message)
end

 채택된 답변

Jon
Jon 2013년 10월 4일

1 개 추천

It's fine now, I didn't account for the fact that I used letters instead of numbers, so:
question = input('say friend and enter ', 's'); str = 'correct'; message = [str]; if (quesition ~= 'friend'); disp(message) end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

질문:

Jon
2013년 10월 4일

답변:

Jon
2013년 10월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by