필터 지우기
필터 지우기

read data from .m file

조회 수: 71 (최근 30일)
zina ben
zina ben 2012년 1월 14일
댓글: Abishek 2023년 11월 6일
hi
I want to store different variables in the same .m file,And after I must read these variables one by one. exemple
1
23 3 4
5 6 4
This is contain of .m file.I need to, load this contain, read 1st and 3 rd rows. I hope you help me. thanks
  댓글 수: 4
Walter Roberson
Walter Roberson 2016년 10월 13일
fileId = fopen('pfoutput.m');
datacell = textscan(fileId, '*%f|%f/%f*', 'HeaderLines', 3, 'CollectOutput', 1);
fclose(fileId);
opPoints = datacell{1};
atsprink
atsprink 2016년 10월 14일
awesome...thank you for the help. I was able to make little tweaks to your solution to work as I needed it to.

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

답변 (1개)

Thomas
Thomas 2012년 1월 17일
Variables are not stored in .m files as they are ASCII, Variables are usually stored in .mat files that matlab can read.
  댓글 수: 1
Abishek
Abishek 2023년 11월 6일
How to read the .m flies

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

카테고리

Help CenterFile Exchange에서 Other Formats에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by