matlab 명령어

 # http://matlab.izmiran.ru/help/techdoc/ref/load.html


load

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 ...




Examples

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:

  • a = magic(4);  b = ones(2, 4) * -5.7;  c = [8 6 4 2];
    save -ascii mydata.dat
    

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:

  • clear
    load mydata.dat
    

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 MonTue, or Wed:

  • load('mydata', '-regexp', '^Mon|^Tue|^Wed');
    

Here is another way of doing the same thing. In this case, there are three separate expression arguments:

  • load('mydata', '-regexp', '^Mon', '^Tue', '^Wed');
    

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): 함수 사용하면 됨

봐볼까











댓글

이 블로그의 인기 게시물

abaqus gpu 사용

Chat GPI 활용

장고 01 : html 연결