Read strings from a text file and pass it to variables
조회 수: 84 (최근 30일)
이전 댓글 표시
I have this code in matlab that seems to read the content of my file
fid = fopen('file.txt');
tline = fgets(fid); while ischar(tline) disp(tline) tline = fgets(fid);
end
fclose(fid);
what I have Included in the file are inputs. they are align in the file in that format
20
40
30
30
Is there a way to grab them one by one and assign them to a variable that is
part of a function such as function [lala]=myfunc(t,k,l,m)
댓글 수: 0
답변 (2개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!