Having a string call another string

조회 수: 2 (최근 30일)
Zachary
Zachary 2024년 6월 17일
댓글: Stephen23 2024년 6월 17일
Hello everyone,
I'm new to matlab and learning it right now.
I was wondering how I would make a string that would prompt the user for an input statement and would output the statment exactly as shown (Your string was: 'hi there').
Enter your string: hi there
Your string was: ‘hi there’
Here is what I have so far and i've tried multiple different ways and cant seem to figure out how to call it back.
txt = input('Enter your string: ',"s");

답변 (1개)

Stephen23
Stephen23 2024년 6월 17일
이동: dpb 2024년 6월 17일
txt = input("Enter your string: ","s");
disp("Your string was: " + txt)
  댓글 수: 2
Zachary
Zachary 2024년 6월 17일
이동: Stephen23 2024년 6월 17일
Thank you so much!
Stephen23
Stephen23 2024년 6월 17일
@Zachary: please remember to click the accept button for answers that helped you!

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

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by