its a big problem for me
조회 수: 2 (최근 30일)
이전 댓글 표시
hi all ,please i want a help , i want to build a simple calculator in matlab , but the problem that the supervisor need the text editor to accept an expression like 5+3-2*4 and the click in the equal button to determine it , so the proble how can I split this expression for example to deal with it , any help please
댓글 수: 0
답변 (2개)
Matt Kindig
2012년 4월 17일
Well the easiest way would be using eval, like
str = '5+3-2*4'; %the text field
answer = eval(str); %when you click the equals button.
Is this allowed?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!