필터 지우기
필터 지우기

Converting an .m file to .mat file and plot the graph

조회 수: 1 (최근 30일)
Victor
Victor 2014년 6월 6일
댓글: Victor 2014년 6월 6일
I have 7 .ini files with content such as:
[text1]
1 = 500
2 = 400
3 = 600
4 = 700
and I want to take the number on the right side of the equal sign for each file and put them in individual columns. so i would have the index 1-n on one column and 7 separate columns of data extracted from those 7 .ini files. I would also like to do all this in a .mat file so i can plot the data afterwards.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 6월 6일
To read your text file
fid=fopen('file.ini')
s=textscan(fid,'%s %s %s')
fclose(fid)
out=str2double(s{3})
  댓글 수: 1
Victor
Victor 2014년 6월 6일
how do i extract the values on the right side of the equal sign into an array? let's say the index goes up to 400 or 500...

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

추가 답변 (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