i cant plot to UIAxes

조회 수: 10 (최근 30일)
khaled barakat
khaled barakat 2018년 3월 31일
편집: Greg 2018년 4월 4일
Hello i have been working on my project but currently i have been stuck on this problem where i cant plot to my UIAxes using my GUI program (app designer) here is my code :
(function 1)
rawdata = uigetfile('*.mat','Select the MATLAB code files', 'MultiSelect', 'on');
varlist = who('-file',rawdata);
app.ListBox.Items = varlist(1);
setappdata(0,'onedata',varlist);
in this function i should upload my .mat file in so i can plot in UIAxes in function 2 :
value = app.StateButton.Value;
x=getappdata(0,'onedata');
plot(app.UIAxes,x);
but each time it tells me
Error using plot
Invalid first data argument.
please help.
  댓글 수: 2
Birdman
Birdman 2018년 3월 31일
Can you share your app?
khaled barakat
khaled barakat 2018년 4월 3일

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

채택된 답변

Greg
Greg 2018년 3월 31일
x=getappdata(0,'onedata');
Gives you the cell array output from the call to who. You can't plot that in any axes.
  댓글 수: 2
khaled barakat
khaled barakat 2018년 4월 3일
편집: khaled barakat 2018년 4월 3일
ok so is there a way i can plot .mat file in uiaxes ? if so how ?
Greg
Greg 2018년 4월 4일
편집: Greg 2018년 4월 4일
You have to load variables from the .mat file, not just reference the cellstr representation of the variable names. I'm sure there are lots of examples on MATLAB Answers for plotting from a .mat file.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by