Read a vector from Excel and use it in several functions in a code

Hi!
I know how to read the data from excel, but I dont know how to make it "visible" for several functions in my Mathlab code. If I read the vector directly into the functions, it takes to much of times.
Can please some help how to do?
Regards Joachim

1 Comment

Pass them as input to the function:
vector=1:5;
MyFcn(vector);
function MyFcn(vector)
disp(vector)
end

Answers (1)

Stephen23
Stephen23 on 14 Aug 2018
Edited: Stephen23 on 14 Aug 2018
Pass the data as input arguments. This is explained well in the MATLAB documentation:

This question is closed.

Asked:

on 14 Aug 2018

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!