Make new folder - MATLAB mkdir - MathWorks Italia (2024)

Make new folder

collapse all in page

Syntax

mkdir folderName

mkdir parentFolder folderName

status = mkdir(___)

[status,msg]= mkdir(___)

[status,msg,msgID]= mkdir(___)

Description

example

mkdir folderName createsthe folder folderName. If folderName exists, MATLAB® issuesa warning. If the operation is not successful, mkdir throwsan error to the Command Window.

example

mkdir parentFolder folderName creates folderName in parentFolder. If parentFolder does not exist, MATLAB attempts to create it.

example

status = mkdir(___) creates the specified folder and returns a status of 1 if the operation is successful or if the folder exists. Otherwise, mkdir returns 0 and does not throw a warning or error to the Command Window. You can use this syntax with any of the input argument combinations in the previous syntaxes.

example

[status,msg]= mkdir(___) also returns the message text for any warning or error that occurs.

example

[status,msg,msgID]= mkdir(___) additionally returns the message ID for any warning or error that occurs.

Examples

collapse all

Create Subfolder in Current Folder

Create Subfolder in Specified Parent Folder

Open Live Script

Create a folder called newfolder in the folder testdata. Use a relative path, where newFolder is at the same level as the current folder.

mkdir ../testdata newFolder

Create Folder That Already Exists

Open Live Script

Create the same folder twice, verifying the status of the operation after each try.

Create the folder newFolder. The operation succeeds, returning a status of 1 with no error or warning message.

[status, msg, msgID] = mkdir('newFolder')
status = logical 1
msg = 0x0 empty char arraymsgID = 0x0 empty char array

Create the folder newFolder again. The operation succeeds again, returning a status of 1. A warning message and message ID inform you that the folder already exists.

[status, msg, msgID] = mkdir('newFolder')
status = logical 1
msg = 'Directory already exists.'
msgID = 'MATLAB:MKDIR:DirectoryExists'

Input Arguments

collapse all

folderNameFolder name
character vector | string scalar

Folder name, specified as a character vector or string scalar. You can specify folderName as an absolute or relative path, unless a parent folder is specified. If you specify a parent folder, then folderName must be a path relative to the parent folder.

If folderName contains a path that includes one or more nonexistent folders, MATLAB attempts to create the nonexistent folder. For example, for the path myFolder\folder1\folder2\targetFolder, if folder1 does not exist, MATLAB creates folder1, creates folder2 within folder1, and creates targetFolder within folder2.

Data Types: char | string

parentFolderParent folder
character vector | string scalar

Parent folder for the new folder, specified as a character vector or string scalar. Specify parentFolder as an absolute or relative path. If parentFolder does not exist, MATLAB attempts to create it.

Data Types: char | string

Output Arguments

collapse all

status — Folder creation status
0 | 1

Folder creation status indicating whether the attempt to create the folder is successful, returned as 0 or 1. If the attempt to create the folder is successful or the folder already exists, then the value of status is 1. Otherwise, the value is 0.

Data Types: logical

msg — Error message
character vector

Error message, returned as a character vector. If an error or warning occurs, msg contains the message text of the error or warning. Otherwise, msg is empty, ''.

msgID — Error message identifier
character vector

Error message identifier, returned as a character vector. If an error or warning occurs, msgID contains the message identifier of the error or warning. Otherwise, msgID is empty, ''.

Tips

  • You can use mkdir to create folders in remote locations. To write to a remote location, folderName or parentName must contain the full path of the file specified as a uniform resource locator (URL) of the form:

    schema_name://path_to_file/folderName

    or

    schema_name://path_to_file/parentName

    It is also valid to use one or three "slash" (/) characters between schema_name and path_to_file. For example:

    schema_name:/path_to_file/folderName

    or

    schema_name:///path_to_file/parentName

    Based on your remote location, schema_name can be one of the values in this table.

    File Systemschema_name
    Amazon S3™s3
    Windows Azure® Blob Storagewasb, wasbs
    HDFS™hdfs

    If the file system being used does not support empty folders then attempting to use mkdir with that service will throw an error. For more information, see Work with Remote Data.

Extended Capabilities

Version History

Introduced before R2006a

expand all

This function supports thread-based environments.

See Also

cd | copyfile | dir | movefile | rmdir

Topics

  • Manage Files and Folders

Comando MATLAB

Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:

 

Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.

Make new folder - MATLAB mkdir- MathWorks Italia (1)

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
  • 日本 (日本語)
  • 한국 (한국어)

Contact your local office

Make new folder - MATLAB mkdir
- MathWorks Italia (2024)

References

Top Articles
Shawa Luangwa Camp | South Luangwa Valley Luxury Camp
Shawa Luangwa Camp, Zambia | in detail
Stockmans Meat Company
Raleigh Craigs List
Www.citizen-Times.com Obituaries
Recruitment Drive/Quick guide
Rice explains personal reason for subdued goal celebration against Ireland
Foodsmart Jonesboro Ar Weekly Ad
Culver's Flavor Of The Day Paducah Ky
Chelsea Marie Boutique
Roadwarden Thais
Celebrating Kat Dennings' Birthday: A Look Into The Life Of A Unique Talent
20 Cozy and Creative Fall Front Porch Ideas to Welcome the Season in Style
Itouch Spa Marana
Lynette Mettey Feet
Watch Jujutsu Kaisen 2nd Season English Sub/Dub online Free on HiAnime.to
.Au Domain Godaddy
BCLC Launches PROLINE Sportsbook at B.C. Retail Locations
co*cker Spaniel For Sale Craigslist
How Much Does Costco Gas Cost Today? Snapshot of Prices Across the U.S. | CostContessa
Haverhill, MA Obituaries | Driscoll Funeral Home and Cremation Service
Umbc Registrar
Adventhealth Employee Handbook 2022
About Us - Carrols Corporation
Should Jenn Tran Join 'Bachelor in Paradise'? Alum Mari Pepin Weighs In
Erfolgsfaktor Partnernetzwerk: 5 Gründe, die überzeugen | SoftwareOne Blog
Harness Divine Power 5E Cleric
Craigslist Cars And Trucks By Owner Seattle
Dr Yakubu Riverview
Shorkie: The Perfect Dog Breed for Families
Wjar Channel 10 Providence
Riverwood Family Services
Shs Games 1V1 Lol
Recharging Iban Staff
Rs3 Bis Perks
Americas Cardroom Promo Code For Existing Users
Carlynchristy
Strange World Showtimes Near Andover Cinema
Liv Morgan Wedgie
13 The Musical Common Sense Media
Best Th13 Base
Craigslist Ct Bridgeport
The Menu Showtimes Near Regal Edwards Ontario Mountain Village
How To Delete Jackd Account
Israel Tripadvisor Forum
SP 800-153 Guidelines for Securing WLANs
Welcome to Predator Masters -- Hunting the Hunters
Watch Races - Woodbine Racetrack
Birmingham National Weather Service
Martin's Point Otc Catalog 2022
Truck Trader Pennsylvania
Latest Posts
Article information

Author: Duncan Muller

Last Updated:

Views: 6368

Rating: 4.9 / 5 (59 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Duncan Muller

Birthday: 1997-01-13

Address: Apt. 505 914 Phillip Crossroad, O'Konborough, NV 62411

Phone: +8555305800947

Job: Construction Agent

Hobby: Shopping, Table tennis, Snowboarding, Rafting, Motor sports, Homebrewing, Taxidermy

Introduction: My name is Duncan Muller, I am a enchanting, good, gentle, modern, tasty, nice, elegant person who loves writing and wants to share my knowledge and understanding with you.