필터 지우기
필터 지우기

about 'load' imperative sentence

조회 수: 1 (최근 30일)
상태 박
상태 박 2020년 11월 13일
댓글: 상태 박 2020년 11월 13일
hello!
my professor gives me homework.
but, i am wondering about homework.
professor wirte source code like this. " load twolink.dat"
is that right sentence?
i know 'load' imperative sentence is applied .mat flile or ascil file.
in advance, thank you about answering
  댓글 수: 1
Stephen23
Stephen23 2020년 11월 13일
"is that right sentence?"
Although for historical reasons load can import text files, I strongly recommend using a function that is specifically for reading text data, e.g. textscan or readtable or readmatrix or dlmread or similar.
I recommend avoiding the command syntax (except from the command line whilst experimenting with the data), instead use function syntax (and import the file data into a variable):

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

채택된 답변

Durganshu
Durganshu 2020년 11월 13일
편집: Durganshu 2020년 11월 13일
load command imports files and data in the MATLAB workspace. As far as .dat file is concerned, a .dat file may contain any kind of information. It could be a binary file or a text based file. There is no standard format for them. In order to load them into workspace, you need to know the format of the .dat file and then decide what commands you need to use. Using just load function may not work. You can use uigetfile for your purpose. You can try implementing this code:
[file_name, file_path] = uigetfile('*.dat', 'Select your file');
file = fullfile(file_path, file_name);
data = load(file);
Hope this helps!
  댓글 수: 1
상태 박
상태 박 2020년 11월 13일
thank you about your answer!
but i need to think more about my homework
thanks to your answer, i understand about 'uigetfile' command!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by