How do I make a script which can call for other scripts for every x time interval?
1 view (last 30 days)
Show older comments
I would like to know the syntax for calling for different scripts for every x intervals in my main script ? How do i achieve that ?
0 Comments
Answers (2)
KSSV
on 16 May 2018
Read about functions in MATLAB. You need to write your script into a function and save it. Every time you can call this function and use. EXample, check the below pseudo code.
function result = mysum(input)
% This function takes input and adds 2 to the input
result = input+2 ;
end
Save the above function...it will be saved as mysum. Now calling the function.
x = 0:1:100 ;
N = length(x) ;
iwant = zeros(size(x)) ;
for i = 1:N
iwant(i) = mysum(x(i)) ; % call the function here
end
See Also
Categories
Find more on Low-Level File I/O in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!