help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Octave adding path of folder and subfolder


From: usman
Subject: Octave adding path of folder and subfolder
Date: Mon, 4 Feb 2019 14:48:13 -0600 (CST)


I have a main program that calls functions to perform a task. However, these
functions are in another directory of the main folder (or these functions
are in sub-directories). I am not sure which commands may I include to
perform this task without any errors.

I tried using addpath(), load(), etc. but I don't know the proper usage, may
be that's a reason.

Maincode.m (Is a file in directory e.g /program/example/maincode.m):

% start of code
plot_traction_force(t_cycle,F_trac_veh);
%end of code

plot_traction_force.m (Is a file in directory e.g
/program/plotfunctions/plot_traction_force.m):

% start of code
function [] = plot_traction_force(t_cycle,F_trac_veh)
% code goes here
end
%end of code

The directory view:

|-->Program
 |-->example
    |--> maincode.m
 |-->plotfunction
    |--> plotftn1.m
    |--> plotftn2.m
 |-->extension
    |-->vehicle_data.m   
    |-->electric_machine_map.m

where plotftn1.m, vehicle_data.m, electric_machine_map.m are functions
called by maincode.m.

I don't know how to implement this for a number of functions that might be
in different directories of the parent directory.

I want to provide my program as a zip file and when the user has it , it
executes and every .m file can call each other in the folder
<http://octave.1599824.n4.nabble.com/file/t373187/2019-02-04.png> 



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]