Use .mat file as input argument in a function.

조회 수: 7(최근 30일)
Tunde Adubi
Tunde Adubi 2022년 4월 3일
댓글: Tunde Adubi 2022년 4월 7일
Assuming a Data.mat file has a table of rows and columns, how can it be used as input arguement so that the elements in any row/column be called up for use in the function?

답변(1개)

Siddharth Bhutiya
Siddharth Bhutiya 2022년 4월 5일
If you look at the value of K in your screenshot you will notice that it is a struct and one of the fields would be the table you are looking for (the name would be the name that you used while creating the MAT file). Once you figure out the name you can use the dot syntax to pass that as input to another function.
>> K = load("data.mat")
K =
struct with fields:
myTable: [4×4 table]
>> SVdata(K.myTable)
  댓글 수: 11
Tunde Adubi
Tunde Adubi 2022년 4월 7일
Oh, sure. I will go through those links and follow it up. Thank you.

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

Community Treasure Hunt

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

Start Hunting!

Translated by