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

歡迎訪問 生活随笔!

生活随笔

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

循环神经网络

matlab判断文件是否损坏,检查 MATLAB 代码文件是否有问题

發(fā)布時間:2023/12/19 循环神经网络 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 matlab判断文件是否损坏,检查 MATLAB 代码文件是否有问题 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

示例

以下示例使用了 lengthofline.m,它是帶有可改進(jìn)代碼的 MATLAB 示例文件。您可以在 matlabroot/help/techdoc/matlab_env/examples 中可以找到該文件。如果要運行本例,請將 lengthofline.m 副本保存到 MATLAB 路徑下。

不帶任何選項的情況下對文件運行 mlint

要對示例文件 lengthofline.m 運行 mlint,請運行以下指令:

mlint('lengthofline')

MATLAB 在命令行窗口中顯示 lengthofline.m 的 M-Lint 消息:

L 22 (C 1-9): The value assigned here to variable 'nothandle' might never be used.

L 23 (C 12-15): NUMEL(x) is usually faster than PROD(SIZE(x)).

L 24 (C 5-11): 'notline' might be growing inside a loop. Consider preallocating for speed.

L 24 (C 44-49): Use STRCMPI(str1,str2) instead of using LOWER in a call to STRCMP.

L 28 (C 12-15): NUMEL(x) is usually faster than PROD(SIZE(x)).

L 34 (C 13-16): 'data' might be growing inside a loop. Consider preallocating for speed.

L 34 (C 24-31): Use dynamic fieldnames with structures instead of GETFIELD.

Type 'doc struct' for more information.

L 38 (C 29): Use || instead of | as the OR operator in (scalar) conditional statements.

L 39 (C 47): Use || instead of | as the OR operator in (scalar) conditional statements.

L 40 (C 47): Use || instead of | as the OR operator in (scalar) conditional statements.

L 42 (C 13-16): 'data' might be growing inside a loop. Consider preallocating for speed.

L 43 (C 13-15): 'dim' might be growing inside a loop. Consider preallocating for speed.

L 45 (C 13-15): 'dim' might be growing inside a loop.Consider preallocating for speed.

L 48 (C 52): There may be a parenthesis imbalance around here.

L 48 (C 53): There may be a parenthesis imbalance around here.

L 48 (C 54): There may be a parenthesis imbalance around here.

L 48 (C 55): There may be a parenthesis imbalance around here.

L 49 (C 17): Terminate statement with semicolon to suppress output (in functions).

L 49 (C 23): Use of brackets [] is unnecessary. Use parentheses to group, if needed.

有關(guān)這些消息及如何改善這些代碼的詳細(xì)信息,請參閱 MATLAB 桌面工具和開發(fā)環(huán)境文檔中的根據(jù)代碼分析器消息更改代碼。

以“顯示 ID”和“將結(jié)果返回到結(jié)構(gòu)體”選項運行 mlint

要將結(jié)果存儲到結(jié)構(gòu)體并包含消息 ID,請運行以下指令:

inform=mlint('lengthofline', '-id')

MATLAB 返回

inform =

19x1 struct array with fields:

message

line

column

id

要查看第一個消息的值,請運行以下指令:

inform(1)

MATLAB 顯示

ans =

message: 'The value assigned here to variable 'nothandle' might never be used.'

line: 22

column: [1 9]

id: 'NASGU'

此處,該消息表示,第 22 行上顯示的值從文件中的第 1 列延伸至第 9 列。NASGU 是消息 'The value assigned here to variable

'nothandle' might never be used.' 的 ID。

使用 mlint 顯示 McCabe 復(fù)雜度

要顯示 MATLAB 代碼文件的 McCabe 復(fù)雜度,需運行 mlint 并選擇 -cyc 選項,如下例所示(假設(shè)已將 lengthofline.m 保存到本地文件夾)。

mlint lengthofline.m -cyc

命令行窗口中的結(jié)果顯示了文件的 McCabe 復(fù)雜度,接著是 M-Lint 消息,如下所示:

L 1 (C 23-34): The McCabe complexity of 'lengthofline' is 12.

L 22 (C 1-9): The value assigned here to variable 'nothandle' might never be used.

L 23 (C 12-15): NUMEL(x) is usually faster than PROD(SIZE(x)).

L 24 (C 5-11): 'notline' might be growing inside a loop. Consider preallocating for speed.

L 24 (C 44-49): Use STRCMPI(str1,str2) instead of using UPPER/LOWER in a call to STRCMP.

L 28 (C 12-15): NUMEL(x) is usually faster than PROD(SIZE(x)).

L 34 (C 13-16): 'data' might be growing inside a loop. Consider preallocating for speed.

L 34 (C 24-31): Use dynamic fieldnames with structures instead of GETFIELD. Type 'doc struct'

for more information.

L 38 (C 29): Use || instead of | as the OR operator in (scalar) conditional statements.

L 39 (C 47): Use || instead of | as the OR operator in (scalar) conditional statements.

L 40 (C 47): Use || instead of | as the OR operator in (scalar) conditional statements.

L 42 (C 13-16): 'data' might be growing inside a loop. Consider preallocating for speed.

L 43 (C 13-15): 'dim' might be growing inside a loop. Consider preallocating for speed.

L 45 (C 13-15): 'dim' might be growing inside a loop. Consider preallocating for speed.

L 48 (C 52): There may be a parenthesis imbalance around here.

L 48 (C 53): There may be a parenthesis imbalance around here.

L 48 (C 54): There may be a parenthesis imbalance around here.

L 48 (C 55): There may be a parenthesis imbalance around here.

L 49 (C 17): Terminate statement with semicolon to suppress output (in functions).

L 49 (C 23): Use of brackets [] is unnecessary. Use parentheses to group, if needed.

總結(jié)

以上是生活随笔為你收集整理的matlab判断文件是否损坏,检查 MATLAB 代码文件是否有问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

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