MATLAB: The code only selects the first if statement and does not do the other elseif statments.

else if statements

Hello, I am generating a code for adding books to a library. However the first if statement if chosen but the last two elseif statements are not chosen. The program reads as green and technically should work but it doesn't work in matlab. The error I get is matrix dimensions do not agree.
function library
prompt=input('What would you like to do: ', 's');
while prompt >=' '
prompt=input('What would you like to do: ', 's');
if prompt == 'add book'
title=input('Title: ', 's');
author=input('Author: ', 's');
pages=input('Number of Pages: ', 's');
fprintf('%s, %s, %s has been added to the library\n', title, author, pages)
elseif prompt == 'quit'
disp('Good-bye')
elseif prompt== 'list books'
title=input('Title: ', 's');
author=input('Author: ', 's');
pages=input('Number of Pages: ', 's');
end
end
end

Best Answer

prompt=input('What would you like to do: ', 's');
while prompt >=' '
prompt=input('What would you like to do: ', 's');
if strcmp(prompt,'add book')
disp('I am here')
title=input('Title: ', 's');
author=input('Author: ', 's');
pages=input('Number of Pages: ', 's');
fprintf('%s, %s, %s has been added to the library\n', title, author, pages)
elseif strcmp(prompt,'quit')
disp('Good-bye')
break
elseif strcmp(prompt,'list books')
title=input('Title: ', 's');
author=input('Author: ', 's');
pages=input('Number of Pages: ', 's');
end
end