Matlab彈出視窗定義

2021-09-11 06:36:00 字數 3212 閱讀 2327

使用uigetfile函式直接在彈出視窗選擇開啟

開啟指定格式的檔案

uigetfile(』.m』) %選擇.m檔案

多種字尾檔案進行選擇性的開啟

[filename,pathname] = …

uigetfile(, 『file selector』);

指定路徑的檔案開啟操作

[filename,pathname,filterindex] = uigetfile(,『mytitle』,…『pathname』)

uigetdir的直接使用

指定某個碟符下的資料夾路徑

dname = uigetdir(『c:』)

matlab根路徑檔案操作

dname = uigetdir(matlabroot , 『matlab根目錄路徑』)

其他命令

cd %獲取當前工作路徑

直接使用uiputfile命令返回檔名

直接輸入uiputfile

[pathname , path] = uiputfile %獲取輸入檔名和路徑

[filename ,pathname, filterindex] = uiputfile(filterspec) %定位檔名和路徑

3.1 當不指定檔名的字尾

[filename , pathname , filterindex] = uiputfile(』 『)

3.2 當指定檔名的字尾

[filename , pathname , filterindex] = uiputfile(』.mat』)

[filename , pathname , filterindex] = uiputfile(filterspec,dialogtitle)

4.1採用預設格式

[filename,pathname,filterindex] = uiputfile(』.mat』 , 』 『)

4.2修改標題

[filename , pathname , filterindex] = uiputfile(』.mat』,『word…』)

[filename,pathname , filterindex] = uiputfile(filterspec,dialogtitle,defaultname)

defaultname:要選擇的檔案的檔名。

採用圖形控制代碼,進行進度檢視

h = waitbar(x,『message』)

close (h) %關閉h

delete(h) %刪除h

wairbar對話方塊提供取消執行按鈕

waitbar(x , 『message』 , 『createcanelbtn』 , 『button_callback』)

function delete_h(h) %刪除h控制代碼

delete(h)

waitbar進度條標題修改

waitbar(x, 『message』 , property_name , property_value , …)

property_name:進度條的名字

property_value:標題的名稱

waitbar函式直接使用

waitbar(x)

x為0~1之間

修改waitbar顯示資訊

waitbar(x,h)

h:顯示資訊

更新進度條資訊顯示值

waitbar(x,h,『updated message』)

errordlg的直接使用

修改錯誤提示字串

h = errordlg(errorstring) %帶字串的錯誤提示

指定錯誤的型別

h = errordlg(errorstring , dlgname)

修改對話方塊資訊顯示

h = errordlg(errorstring , dlgname , createmode)

warndlg直接使用

修改警告提示字串

h = wandlg(warningstring)

指定警告的型別

h = warndlg(errorstring , dlgname)

修改警告對話方塊資訊顯示

h = warndlg(errorstring ,dlgname , createmode)

msgbox(』 ***x』)直接使用

修改顯示標題

h = msgbox(』 ***』, '標題』)

msgbox顯示具體的圖示

h = msgbox(message,title,icon)

設定使用者自己的圖示

h = msgbox(message, title, 『custom』 , icondata,iconcmap)

修改警告對話方塊資訊顯示

h = msgbox(_,createmode)

直接使用

button = questdlg(『qstring』)

修改提問對話方塊

button = questdlg(『qstring』 , 『標題』)

設定彈出對話方塊的按鍵

button = questdlg(『string』 , 『title』 , 『default』)

修改選擇按鈕的顯示字串

button = questdlg(『qstring』 , 『標題』,『str1』,『str2』,default)

設定對話方塊為3個可選按鈕

button = questdlg(『qstring』 , 『標題』,『str1』,『str2』,『str3』,default)

顯示公式文字選項

button = questdlg(『qstring』 , 『標題』,…,options)

直接採用預設方式

answer = inputdlg(』 ')

輸入對話方塊標題修改

answer = inputdlg(』 』 , 』資料輸入』)

增加輸入的行數

answer = inputdlg(prompt ,dlg_title)

修改輸入的維數

answer = inputdlg('prompt , dlg_title, num_lines)

設定輸入對話方塊的預設值

answer = inputdlg('prompt , dlg_title , num_lines , defans)

修改顯示字型

answer = inputdlg('prompt , dlg_title , num_lines , defans , options)

彈出自定義視窗

1.window物件的open方法 window的open方法用於建立乙個新視窗,語法如下 window.open url,windowname windowfeatures replaceflag url 彈出視窗的url位址 windowname 彈出視窗的名稱,可為空 windowfeatur...

ajax彈出視窗提示與彈出視窗

如果用了updatepanel 彈出的寫法 scriptmanager.registerstartupscript this.updatepanel1,page.gettype alert 彈出提示 true scriptmanager.registerstartupscript this.upda...

彈出網頁視窗

1.彈出乙個全屏視窗 onclick window.open url,example01 fullscreen 2.彈出乙個被f11化後的視窗 nclick window.open url,example02 channelmode 3.彈出乙個帶有收藏鏈結工具欄的視窗 nclick window....