필터 지우기
필터 지우기

GUI text box - Replacing a word entered in the text box.

조회 수: 2 (최근 30일)
Zach
Zach 2011년 5월 31일
I have a textbox in my GUI right now and I want the students to input something of the for "10*x(n)" , but for the code to work it has to be "10*x(1)". Is there a way to replace the incoming x(n) with x(1) ?

채택된 답변

Matt Fig
Matt Fig 2011년 5월 31일
str = '10*x(n)'
str2 = strrep(str,'n','1')
  댓글 수: 2
Zach
Zach 2011년 5월 31일
so if I'm getting it from my text box would it be
str=get(handles.textbox,'string')
str2=strrep(str,'n','1')
Matt Fig
Matt Fig 2011년 5월 31일
That's the idea!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by