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

歡迎訪問 生活随笔!

生活随笔

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

循环神经网络

matlab空格会消失了,如何在Matlab中自动删除保存的尾随空格?

發布時間:2023/12/1 循环神经网络 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 matlab空格会消失了,如何在Matlab中自动删除保存的尾随空格? 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我有同樣的需求,并寫了一個小腳本來做一些接近的事情.將以下內容放在

MATLAB desktop shortcut中.每當您單擊快捷方式按鈕時,它將從編輯器中的活動文件中刪除尾隨空格.不如在保存時自動執行它 – 你需要記住在保存之前按下按鈕 – 但差不多.測試在11b,12a和13b,但在12b也應該沒問題.

希望有所幫助!

% Temp variable for shortcut. Give it an unusual name so it's unlikely to

% conflict with anything in the workspace.

shtcutwh__ = struct;

% Check that the editor is available.

if ~matlab.desktop.editor.isEditorAvailable

return

end

% Check that a document exists.

shtcutwh__.activeDoc = matlab.desktop.editor.getActive;

if isempty(shtcutwh__.activeDoc)

return

end

% Get the current text.

shtcutwh__.txt = shtcutwh__.activeDoc.Text;

% Remove trailing whitespace from each line.

shtcutwh__.lines = deblank(regexp(shtcutwh__.txt,'[^\n]*(\n)|[^\n]*$', 'match'));

% Reconcatenate lines.

shtcutwh__.addNewline = @(x)sprintf('%s\n',x);

shtcutwh__.lines = cellfun(shtcutwh__.addNewline, shtcutwh__.lines, 'UniformOutput', false);

shtcutwh__.newtxt = horzcat(shtcutwh__.lines{:});

% Set the current text.

shtcutwh__.activeDoc.Text = shtcutwh__.newtxt;

% Delete temp variable.

clear shtcutwh__

總結

以上是生活随笔為你收集整理的matlab空格会消失了,如何在Matlab中自动删除保存的尾随空格?的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。