필터 지우기
필터 지우기

Is there any way to find it?

조회 수: 1 (최근 30일)
new user 00
new user 00 2018년 7월 3일
댓글: new user 00 2018년 7월 3일
i have to load a file in one callback function of gui in matlab. It will have two arrays. But i don't know the name of the stored arrays. I need to retrive them and use them in another callback function of the same gui. How do i do these tasks?

채택된 답변

Rik
Rik 2018년 7월 3일
You can load the variables into a struct with the following syntax
s=load('yourfile.mat');
Then you can get the variable names it contains with the fieldnames function. To share this data between the two callbacks, you can simply use the guidata handles struct.
  댓글 수: 4
Rik
Rik 2018년 7월 3일
If you want to rename struct fields, you can read this blog post by Loren.
new user 00
new user 00 2018년 7월 3일
@Stephen Cobeldick K.. Say I have an if condition to check the value of the first array element to identify the right field to be named correctly. Now how do I assess the fields one by one? The total number of fields is just 2. @Rik Wisselink Thank you so much. I'm sure it'll help me a lot.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by