MATLAB Answers


Why can I not plot in app designer?

Hey everyone. I am trying to import three numbers into an array called A, and just simply plot them in app designer. But the graph I have does not show up anything... it just does not plot... I genuinely don`t understand why...
% Button pushed function: StartanalysisButton
function StartanalysisButtonPushed(app, event)
A = importdata('jerk_metric.txt');
app.UIAxes.YLim = [-1 1];
app.UIAxes.XLim = [-1 1];
plot(app.UIAxes, A);

  댓글 수: 3

What can you tell us about A? Is it an empty matrix? If not, does the data fit within the limits that you have defined for the axes?
A is just 3 numbers: 0.54,0.65,0.43 It does fit in the limits
I have 6 .m files all connected and the variables stored in A are the result of a function. So i tried saving it in differemt files tyoes (txt, xls) but could not use it in gui or app designer

로그인 to comment.

답변 수: 1

Chris Portal 님의 답변 14 Apr 2019
 채택된 답변

The data doesn’t fit within your limits. By only specifying the A vector you mentioned, you are only specifying the Y axes values to PLOT. This means PLOT uses [1 2 3 ...] as your X axes values, which puts your data outside the limits you specified.

  댓글 수: 0

로그인 to comment.

Translated by