필터 지우기
필터 지우기

How to import data into function apart from the inputs?

조회 수: 1 (최근 30일)
Neilabh Banzal
Neilabh Banzal 2020년 5월 4일
댓글: Mohammad Sami 2020년 5월 5일
Hello,
I am currently in the process of making a sensor model which has a lot of arameters involved in the model. I have currently written the code in scripts. I have a main script that calls other scripts whenever needed, and modifies the data as per the requirements. The variables are all in the workspace and can be modified as per need whenever needed.
Now, the problem is that according to the team's requirements, I am supposed to write the codes in a OOP style. This means that I have to move from scripts to functions. I am unable to figure out how to import a bunch of variables, say 10+ variables into the function apart from the input arguments, which I feel would make the functions too complicated to use.
Is there any other way to import data from mat files or similar?
Another concern is that I am working with a huge 30000 x 10 table. If I call this via a function, it will pe passed by value, which will make th code slow to run. Is there any way to pass the table by reference?
Thank you,
Neilabh
  댓글 수: 3
Neilabh Banzal
Neilabh Banzal 2020년 5월 4일
Thank you. I will definitely try out the Handle Class.
The Handle Class can be used as a structure, right?
And, I am afrraid I am modifying my table in each function call.
Mohammad Sami
Mohammad Sami 2020년 5월 5일
If you wish you can use it like a strucutre. you can make all the properties public.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by