Write a getString() function that prompts the user for a string and returns it

Call getString() function to get the string from the user. I can't get the string from the function.
function getstring()
input('Enter A String: ','s');
end

 채택된 답변

function str = getstring()
str = input('Enter A String: ','s');
end

댓글 수: 3

sir I am asked to call getstring and the call function testpalindromes which uses getstring as a string and tests the string here is my code can plz correct my mistakes
function testpalindromes()
if strcmpi(str,fliplr(str))
fprintf('yes %s is a palindrome \n',str)
else
fprintf('no %s is not a palindrome \n',str)
end
it is working right...
Yes It is working But it is not using the getstring function to test

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품

태그

아직 태그를 입력하지 않았습니다.

질문:

2016년 12월 1일

댓글:

2016년 12월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by