How to use the same .mat files in different activities AppDesigner

조회 수: 1 (최근 30일)
Pedro Guincho
Pedro Guincho 2020년 7월 10일
댓글: jonas 2020년 7월 10일
Hello everyone!
I'm new to AppDesigner and I'm trying to create an app where I load a raw signal, perform pre-processing and feature extraction, save this new processed signal and then perform some statistical analysis. How can I sequently use the .mat file I need, without having to load it for every action?
Thanks!

답변 (1개)

jonas
jonas 2020년 7월 10일
You could put the content of the .mat file in a public property. Go to code view > select properties > add a public property.
properties (Access = public)
data = load('filename.mat')
end
You can then access the data through
app.data
  댓글 수: 2
Pedro Guincho
Pedro Guincho 2020년 7월 10일
Yes, I try to do that. The problem is that I have different .mat files and I want to work with the one I choose from the search tab with the code below. How can I atribute the chosen file to the initial property?
% Button pushed function: STARTButton_2
function STARTButton_2Pushed(app, event)
if app.DAQButton_2.Value == true;
app.TabGroup.SelectedTab = app.DAQTab;
else app.LoadmatfileButton_2.Value = true;
app.TabGroup.SelectedTab = app.PrProcessingTab;
[file,path] = uigetfile('*.mat', 'Select a File');
load (fullfile(path,file))
[f,P1]=plot_FFT(100000,captured_data);
plot(app.UIAxes2, f , P1);
end
end
jonas
jonas 2020년 7월 10일
I'm not sure I follow. What is the problem? Just ask the user for the file and put it in the public property. You want the user to be able to switch between files? Just replace the content of the public property.

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

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by