https://ww2.mathworks.cn/help/matlab/ref/mkdir.html
mkdir
-
语法
[mkdir folderName](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#d122e795624)
[mkdir parentFolder folderName](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#d122e795647)
[status = mkdir(**___**)](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#d122e795674)
[[status,msg] = mkdir(**___**)](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#d122e795698)
[[status,msg,msgID] = mkdir(**___**)](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#d122e795717)
说明
mkdir [
folderName](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#f7-607707-folderName)
创建文件夹folderName
。如果folderName
存在,则 MATLAB 发出警告。如果操作失败,则mkdir
会向命令行窗口发出错误。mkdir [
parentFolder](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#f7-607707-parentFolder) [
folderName](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#f7-607707-folderName)
在parentFolder
中创建folderName
。如果parentFolder
不存在,MATLAB 会尝试创建它。`[status](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#f7-607707-status)
= mkdir(_)创建指定的文件夹,并在操作成功或文件夹已存在时返回状态
1。否则,
mkdir返回
0`,并且不会在命令行窗口中引发警告或错误。您可以将此语法与上述语法中的任何输入参数结合使用。[[
status](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#f7-607707-status),[
msg](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#f7-607707-msg)] = mkdir(**___**)
还返回发生的任何警告或错误的消息文本。[[
status](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#f7-607707-status),[
msg](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#f7-607707-msg),[
msgID](https://ww2.mathworks.cn/help/matlab/ref/mkdir.html?searchHighlight=%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9&s_tid=srchtitle#f7-607707-msgID)] = mkdir(**___**)
还返回发生的任何警告或错误的消息 ID。