Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.fds-net.ru/showflat.php?Number=6735682&src=arc&showlite=
Дата изменения: Unknown
Дата индексирования: Tue Apr 12 18:12:38 2016
Кодировка: Windows-1251

Поисковые слова: m 5
как в матлабе записать квадратную матрицу в файл тхт? - Public forum of MSU united student networks
Root | Google | Yandex | Mail.ru | Kommersant | Afisha | LAN Support
  
General Discussion >> Study (Archive)

Страницы: 1
Demandeur
monsieur

Рег.: 02.12.2005
Сообщений: 137
Рейтинг: 11
  как в матлабе записать квадратную матрицу в файл тхт?
      13.10.2007 23:25
1

скажите, пожалуйста, что за функция?



merci pour vos réponses
cyhdyk

Рег.: 11.03.2006
Сообщений: 22
Рейтинг: 20
  Re: как в матлабе записать квадратную матрицу в файл тхт? [re: Demandeur]
      13.10.2007 23:35
 

dmlwrite - пишет в файл
dlmread - читает из файла
Может быть есть другие варианты, не знаю.


Demandeur
monsieur

Рег.: 02.12.2005
Сообщений: 137
Рейтинг: 11
  Re: как в матлабе записать квадратную матрицу в файл тхт? [re: cyhdyk]
      13.10.2007 23:40
 

не описка? у меня че-то таких функций вообще не находит.. :confused:



merci pour vos réponses
Demandeur
monsieur

Рег.: 02.12.2005
Сообщений: 137
Рейтинг: 11
  Re: как в матлабе записать квадратную матрицу в файл тхт? [re: Demandeur]
      14.10.2007 02:18
1

помогите, это ж банальщина для многих наверняка! Я матлаб-новичок



merci pour vos réponses
Vibe
Carpal Tunnel

Рег.: 06.09.2005
Сообщений: 24409
Из: SWE
Рейтинг: 5119
  Re: как в матлабе записать квадратную матрицу в файл тхт? [re: Demandeur]
      14.10.2007 03:25
1

если собираешься использовать файл в матлабе, то есть команды load/save. Напиши в матлабе help save там подробно распишут, что и как.

Demandeur
monsieur

Рег.: 02.12.2005
Сообщений: 137
Рейтинг: 11
  Re: как в матлабе записать квадратную матрицу в файл тхт? [re: Vibe]
      14.10.2007 15:09
1

не, я хочу в С использовать. Есть такая возможность?



merci pour vos réponses
Vibe
Carpal Tunnel

Рег.: 06.09.2005
Сообщений: 24409
Из: SWE
Рейтинг: 5119
  Re: как в матлабе записать квадратную матрицу в файл тхт? [re: Demandeur]
      14.10.2007 15:24
 

у меня просто матлаба подрукой нет, и я не помню как они сохраняют, в каком формате. Потому как использую только в матлабе. Почитай хелп для save может есть какое-какие опции.
Кстати, я слышал, что есть в матлабе опция скомпилировать кусок кода в си, правда может это только слухи :)

cyhdyk

Рег.: 11.03.2006
Сообщений: 22
Рейтинг: 20
  Re: как в матлабе записать квадратную матрицу в файл тхт? [re: Vibe]
      14.10.2007 16:16
2

>> help dlmread
 DLMREAD Read ASCII delimited file.
    RESULT = DLMREAD(FILENAME) reads numeric data from the ASCII
    delimited file FILENAME. The delimiter is inferred from the formatting
    of the file.
 
    RESULT = DLMREAD(FILENAME,DELIMITER) reads numeric data from the ASCII
    delimited file FILENAME using the delimiter DELIMITER. The result is
    returned in RESULT. Use '\t' to specify a tab.
 
    When a delimiter is inferred from the formatting of the file,
    consecutive whitespaces are treated as a single delimiter. By
    contrast, if a delimiter is specified by the DELIMITER input, any
    repeated delimiter character is treated as a separate delimiter.
 
    RESULT = DLMREAD(FILENAME,DELIMITER,R,C) reads data from the
    DELIMITER-delimited file FILENAME. R and C specify the row R and column
    C where the upper-left corner of the data lies in the file. R and C are
    zero-based so that R=0 and C=0 specifies the first value in the file.
 
    All data in the input file must be numeric. DLMREAD does not operate
    on files containing nonnumeric data, even if the specified rows and
    columns for the read contain numeric data only.
 
    RESULT = DLMREAD(FILENAME,DELIMITER,RANGE) reads the range specified
    by RANGE = [R1 C1 R2 C2] where (R1,C1) is the upper-left corner of
    the data to be read and (R2,C2) is the lower-right corner. RANGE
    can also be specified using spreadsheet notation as in RANGE = 'A1..B7'.
 
    DLMREAD fills empty delimited fields with zero. Data files where
    the lines end with a non-space delimiter will produce a result with
    an extra last column filled with zeros.
 
    See also dlmwrite, textscan, load, fileformats.


    Reference page in Help browser
     doc dlmread

>> help dlmwrite
 DLMWRITE Write ASCII delimited file.
 
    DLMWRITE('FILENAME',M) writes matrix M into FILENAME using ',' as the
    delimiter to separate matrix elements.
 
    DLMWRITE('FILENAME',M,'DLM') writes matrix M into FILENAME using the
    character DLM as the delimiter.
 
    DLMWRITE('FILENAME',M,'DLM',R,C) writes matrix M starting at
    offset row R, and offset column C in the file. R and C are zero-based,
    so that R=C=0 specifies the first value in the file.
 
    DLMWRITE('FILENAME',M,'ATTRIBUTE1','VALUE1','ATTRIBUTE2','VALUE2'...)
    An alternative calling syntax that uses attribute value pairs for
    specifying optional arguments to DLMWRITE. The order of the
    attribute-value pairs does not matter, as long as an appropriate value
    follows each attribute tag.
 
     DLMWRITE('FILENAME',M,'-append') appends the matrix to the file.
     without the flag, DLMWRITE overwrites any existing file.
 
     DLMWRITE('FILENAME',M,'-append','ATTRIBUTE1','VALUE1',...)
     Is the same as the previous syntax, but accepts attribute value pairs,
     as well as the '-append' flag. The flag can be placed in the argument
     list anywhere between attribute value pairs, but not between an
     attribute and its value.
 
    USER CONFIGURABLE OPTIONS
 
    ATTRIBUTE : a quoted string defining an Attribute tag. The following
     attribute tags are valid -
     'delimiter' => Delimiter string to be used in separating matrix
     elements.
     'newline' => 'pc' Use CR/LF as line terminator
     'unix' Use LF as line terminator
     'roffset' => Zero-based offset, in rows, from the top of the
     destination file to where the data it to be
     written.
     'coffset' => Zero-based offset, in columns, from the left side
     of the destination file to where the data is to be
     written.
     'precision' => Numeric precision to use in writing data to the
     file, as significant digits or a C-style format
     string, starting with '%', such as '%10.5f'. Note
     that this uses the operating system standard
     library to truncate the number.
 
    EXAMPLES:
 
    DLMWRITE('abc.dat',M,'delimiter',';','roffset',5,'coffset',6,...
    'precision',4) writes matrix M to row offset 5, column offset 6, in
    file abc.dat using ; as the delimiter between matrix elements. The
    numeric precision is of the data is set to 4 significant decimal
    digits.
 
    DLMWRITE('example.dat',M,'-append') appends matrix M to the end of
    the file example.dat. By default append mode is off, i.e. DLMWRITE
    overwrites the existing file.
 
    DLMWRITE('data.dat',M,'delimiter','\t','precision',6) writes M to file
    'data.dat' with elements delimited by the tab character, using a precision
    of 6 significant digits.
    
    DLMWRITE('file.txt',M,'delimiter','\t','precision','%.6f') writes M
    to file file.txt with elements delimited by the tab character, using a
    precision of 6 decimal places.
 
    DLMWRITE('example2.dat',M,'newline','pc') writes M to file
    example2.dat, using the conventional line terminator for the PC
    platform.
 
    See also dlmread, csvwrite, csvread, num2str, textscan, strread,
    importdata, sscanf, sprintf, wk1write, wk1read.


    Reference page in Help browser
     doc dlmwrite

load/save c параметром -ascii тоже должно работать


Demandeur
monsieur

Рег.: 02.12.2005
Сообщений: 137
Рейтинг: 11
  Re: как в матлабе записать квадратную матрицу в файл тхт? [re: cyhdyk]
      14.10.2007 16:47
 

спасибо, дружище! не заметил, оказывается dlm, а не dml !
2Vibe - тоже спасибо!



merci pour vos réponses
Страницы: 1

General Discussion >> Study (Archive)

Дополнительная информация
0 зарегистрированных и 0 анонимных пользователей просматривают этот форум.

Модераторы:  Basilio, The_Nameless_One 

Печать темы

Права
      Вы можете создавать новые темы
      Вы можете отвечать на сообщения
      HTML отключен
      UBBCode включен

Рейтинг:
Просмотров темы:

Переход в