Ask an expert. Trust the answer.

Your academic and career questions answered by verified experts

How do I import/include MATLAB functions?

Date: 2022-07-01 10:59:36

I have some MATLAB functions defined in .m files and I'd like to import them into MATLAB (as in I'd like to be able to call them as I do a built-in function). How can I do this? 

Answers: 

If the folder just contains functions then adding the folders to the path at the start of the script will suffice. 

 

addpath('../folder_x/');
addpath('../folder_y/');

If they are Packages, folders starting with a '+' then they also need to be imported. 

 

import package_x.*
import package_y.*

 


Why Matlabhelpers ?

Our Matlab assignment helpers for online MATLAB assignment help service take utmost care of your assignments by keeping the codes simple yet of high-quality. We offer the most reliable MATLAB solutions to students pursuing their Computer Science course from the Monash University, the University of Sydney, the University of New South Wales, the University of Melbourne; to name a few. Approach us today for best Matlab solutions online!

whatsApp order on matlabhelpers.com

telegram order on matlabsolutions.com