Private Functions in MATLAB Last Updated : 05 Apr, 2022 Comments Improve Suggest changes 1 Likes Like Report Private functions are useful when you want to limit the scope of a function. Here we will learn how to create private functions and also use them. Private functions are primary functions that are visible only to a limited group of other functions. Generally, we make private functions, if we want to abstract the implementation of a function or in other words limits the scope of the function. We can make a function private by storing it in a subfolder with the name private, as private functions reside in a subfolder. After storing, the function is now available only to functions immediately above the private subfolder or in other words to the parent folder, in the folder where you stored the function. Now, create a subfolder with the name private, then create a function in a file named gfg.m, but do not add private to it. Example: Matlab % MATLAB code for Private function definition function fgf = gfg(a,b,c) fgf = sqrt(b^2 - 4*a*c); end Now, create a function tri.m in the working directory. Matlab % MATLAB code for Private Function function [y1,y2] = tri(a,b,c) d = fgf(a,b,c); y1 = (-b + d) / (2*a); y2 = (-b - d) / (2*a); end % To run it on the command prompt: % Input the value tri(2,4,-4) Output: >> 0.73205 Create Quiz Comment R rajzzz Follow 1 Improve R rajzzz Follow 1 Improve Article Tags : Software Engineering MATLAB-Functions Explore Software Engineering BasicsIntroduction to Software Engineering7 min readSoftware Development Life Cycle (SDLC)8 min readSoftware Quality - Software Engineering5 min readISO/IEC 9126 in Software Engineering4 min readBoehm's Software Quality Model4 min readSoftware Crisis - Software Engineering3 min readSoftware Measurement & MetricesSoftware Measurement and Metrics4 min readPeople Metrics and Process Metrics in Software Engineering7 min readHalsteadâs Software Metrics - Software Engineering10 min readCyclomatic Complexity6 min readFunctional Point (FP) Analysis - Software Engineering8 min readLines of Code (LOC) in Software Engineering4 min readSoftware Development Models & Agile MethodsWaterfall Model - Software Engineering12 min readWhat is Spiral Model in Software Engineering?9 min readPrototyping Model - Software Engineering7 min readIncremental Process Model - Software Engineering6 min readRapid Application Development Model (RAD) - Software Engineering9 min readCoupling and Cohesion - Software Engineering10 min readAgile Software Development - Software Engineering15+ min readSRS & SPMSoftware Requirement Specification (SRS) Format5 min readSoftware Engineering | Quality Characteristics of a good SRS7 min readSoftware Project Management (SPM) - Software Engineering8 min readCOCOMO Model - Software Engineering15+ min readCapability Maturity Model (CMM) - Software Engineering10 min readIntegrating Risk Management in SDLC | Set 18 min readSoftware Maintenance - Software Engineering13 min readTesting & DebuggingWhat is Software Testing?11 min readTypes of Software Testing15+ min readTesting Guidelines - Software Engineering3 min readWhat is Debugging in Software Engineering?11 min readVerification & ValidationVerification and Validation in Software Engineering6 min readRole of Verification and Validation (V&V) in SDLC5 min readRequirements Validation Techniques - Software Engineering8 min readPractice QuestionsTop 50+ Software Engineering Interview Questions and Answers15+ min read Like