日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 人工智能 > 循环神经网络 >内容正文

循环神经网络

matlab中 seek,VBA中的seek与matlab中的fseek的说明 | 学步园

發(fā)布時(shí)間:2023/12/20 循环神经网络 50 豆豆
生活随笔 收集整理的這篇文章主要介紹了 matlab中 seek,VBA中的seek与matlab中的fseek的说明 | 学步园 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

VBA: Seek 語(yǔ)句

語(yǔ)法:Seek [#]filenumber, position

其中position 為介于 1~ 2,147,483,647(相當(dāng)于 2^31 – 1)之間的數(shù)字,指出下一個(gè)讀寫操作將要發(fā)生的位置。

功能:在 Open 語(yǔ)句打開的文件中,設(shè)置下一個(gè)讀/寫操作的位置。

說明:可以用Seek語(yǔ)句指定Get語(yǔ)句的讀取位置,但在 Get 及 Put 語(yǔ)句中指定的記錄號(hào)將覆蓋由 Seek 語(yǔ)句指定的文件位置。

示例:

Dim MaxSize, NextChar, MyChar

Open "TESTFILE" For Input As #1

MaxSize = LOF(1)??? ???' 取得文件的總字符數(shù)。

' 用循環(huán)讀入所有記錄,但是從最后的記錄開始往前讀。

For NextChar = MaxSize To 1 Step -1

Seek #1, NextChar??? ??' 設(shè)置讀寫位置。

MyChar = Input(1, #1)??? ??' 讀入一字符。

Next NextChar

Close #1

VBA、Seek 函數(shù)

語(yǔ)法:Seek(filenumber)

功能:返回一個(gè) Long,在 Open 語(yǔ)句打開的文件中指定當(dāng)前的讀/寫位置。

說明:在使用Get語(yǔ)句讀取文件時(shí),必須用LOF函數(shù)來(lái)判斷是否到達(dá)文件末尾,而不是用EOF函數(shù)。可以使用Seek函數(shù)判斷當(dāng)前位置,然后與LOF的值比較。

示例:

Do While Seek(1) < LOF(1)

'繼續(xù)讀取

......

Loop

Matlab 的fseek函數(shù)

help fseek

FSEEK Set file position indicator.

STATUS = FSEEK(FID, OFFSET, ORIGIN) repositions the file position

indicator in the file associated with the given FID.? FSEEK sets the

position indicator to the byte with the specified OFFSET relative to

ORIGIN.

FID is an integer file identifier obtained from FOPEN.

OFFSET values are interpreted as follows:

>= 0??? Move position indicator OFFSET bytes after ORIGIN.

< 0??? Move position indicator OFFSET bytes before ORIGIN.

ORIGIN values are interpreted as follows:

'bof' or -1?? Beginning of file

'cof' or? 0?? Current position in file

'eof' or? 1?? End of file

STATUS is 0 on success and -1 on failure.? If an error occurs, use

FERROR to get more information.

Example:

fseek(fid,0,-1)

"rewinds" the file.

doc fseek:

fseek

Set file position indicator

Syntax

status = fseek(fid, offset, origin)

Description

status = fseek(fid, offset, origin) repositions the file position indicator in the file with the given fid to the byte with the specified offset relative to origin.

For a file having n bytes, the bytes are numbered from 0 to n-1. The position immediately following the last byte is the end-of-file, or eof, position. You would seek to the eof position if you wanted to add data to the end of a file.

This figure represents a file having 12 bytes, numbered 0 through 11. The first command shown seeks to the ninth byte of data in the file. The second command seeks just past the end of the file data, to the eof position.

fseek does not seek beyond the end of file eof position. If you attempt to seek beyond eof, MATLAB returns an error status.

Arguments

fid An integer file identifier obtained from fopen

offsetA value that is interpreted as follows,

offset > 0Move position indicator offset bytes toward the end of the file.offset = 0Do not change position.offset < 0Move position indicator offset bytes toward the beginning of the file.originA string whose legal values are

'bof'-1: Beginning of file'cof'0: Current position in file'eof'1: End of filestatusA returned value that is 0 if the fseek operation is successful and -1 if it fails. If an error occurs, use the function ferror to get more information.

Examples

This example opens the file test1.dat, seeks to the 20th byte, reads fifty 32-bit unsigned integers into variable A, and closes the file. It then opens a second file, test2.dat, seeks to the end-of-file position, appends the data in A to the end of this file, and closes the file.

fid = fopen('test1.dat', 'r');

fseek(fid, 19, 'bof');

A = fread(fid, 50, 'uint32');

fclose(fid);

fid = fopen('test2.dat', 'r+');

fseek(fid, 0, 'eof');

fwrite(fid, A, 'uint32');

fclose(fid)

總結(jié)

以上是生活随笔為你收集整理的matlab中 seek,VBA中的seek与matlab中的fseek的说明 | 学步园的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。