matlab 명령어
# http://matlab.izmiran.ru/help/techdoc/ref/load.html
Load workspace variables from disk
Syntax
load load('filename') load('filename', 'X', 'Y', 'Z') load('filename',
'-regexp'
, exprlist) load('-mat'
, 'filename') load('-ascii'
, 'filename') S = load(...) load filename-regexp
expr1 expr2 ...
Example 1 -- Loading From a Binary MAT-file
To see what is in the MAT-file prior to loading it, use whos
-file
:
whos -file mydata.mat Name Size Bytes Class javArray 10x1 java.lang.Double[][] spArray 5x5 84 double array (sparse) strArray 2x5 678 cell array x 3x2x2 96 double array y 4x5 1230 cell array
Clear the workspace and load it from MAT-file mydata.mat
:
clear load mydata whos Name Size Bytes Class javArray 10x1 java.lang.Double[][] spArray 5x5 84 double array (sparse) strArray 2x5 678 cell array x 3x2x2 96 double array y 4x5 1230 cell array
Example 2 -- Loading From an ASCII File
Create several 4-column matrices and save them to an ASCII file:
Clear the workspace and load it from the file mydata.dat
. If the filename has an extension other than .mat
, MATLAB assumes that it is ASCII:
MATLAB loads all data from the ASCII file, merges it into a single matrix, and assigns the matrix to a variable named after the filename:
mydata mydata = 16.0000 2.0000 3.0000 13.0000 5.0000 11.0000 10.0000 8.0000 9.0000 7.0000 6.0000 12.0000 4.0000 14.0000 15.0000 1.0000 -5.7000 -5.7000 -5.7000 -5.7000 -5.7000 -5.7000 -5.7000 -5.7000 8.0000 6.0000 4.0000 2.0000
Example 3 -- Using Regular Expressions
Using regular expressions, load from MAT-file mydata.mat
those variables with names that begin with Mon
, Tue
, or Wed
:
Here is another way of doing the same thing. In this case, there are three separate expression arguments:
See Also
실행파일 생성
function 실행파일명()
>> mcc -m 실행파일.m
mat를 xlx로 변환
load 파일명.mat;
filename = '파일명.xlsx';
xlswrite(filename,파일명);
행렬 명령어
=======
1:5
1 2 3 4 5
=======
0:.1:2*pi
0부터 2*pi 까지
.1 의 간격으로 생성됨
=======
linsepace (star,stop,npoints): 함수 사용하면 됨
봐볼까
댓글
댓글 쓰기