필터 지우기
필터 지우기

getting a number from a text file

조회 수: 2 (최근 30일)
Tariq Hammoudeh
Tariq Hammoudeh 2021년 12월 5일
댓글: Walter Roberson 2021년 12월 5일
I have txt file with 1 number inside only, nothing else.
is there a way to get that number as a variable so that i can use an if statement on it, more specifically if an inputted number is greater than the number in the txt file.
  댓글 수: 7
Star Strider
Star Strider 2021년 12월 5일
Walter Roberson
Walter Roberson 2021년 12월 5일
filename = 'CashReserve.txt');
R = readmatrix(filename);
R = R - 1234.56;
writematrix(R, filename);

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by