App designer putting components over plot

조회 수: 9 (최근 30일)
Isaiah
Isaiah 2025년 4월 2일
댓글: Isaiah 2025년 4월 4일
Hi,
I am working on a project that utilizes the app designer feature in matlab. I am trying to display a plot, and have a button and some output fields below the plot.
In the AppDesigner I have a plot with labels, and a couple components I just mentioned below (see image: AppDesigner). When I run the app, the formatting seems to be lost and the button, slider, and output field fall onto the plot (see image: Appoutput). The button is a call back which i used to run a matlab function that does some calculations and spits out a constant, and an array. The array is called car.r which is the only thing plotted, and the constant is called D which is outputed in the text box labeled "Outer Turning Diameter".
This is the only code that relates to the outputs. The slider and the box labeled yaw rate are not being used right now.
I am not sure why this formatting occurs. When I see other people put plots in with buttons, there's seem to work first try without any extra code or formatting. Does anyone know the solution to this problem? Thanks
%% Output
app.OuterTurningDiameterEditField.Value = num2str(round(D, 2))
%% Plotting
car.r = car.r * 3.28084;
plot(app.UIAxes, car.r(:, 1), car.r(:, 2), 'b-')
hold(app.UIAxes);
app.UIAxes.XLim = [min(car.r(:, 1)), max(car.r(:, 1))] + [-1, 1];
app.UIAxes.YLim = [min(car.r(:, 2)), max(car.r(:, 2))] + [-1, 1];
  댓글 수: 8
Isaiah
Isaiah 2025년 4월 3일
I am using 2023a, the code you mentioned that is not working correctly is inside the greyed section which is not editable. Is there a way to fix that?
Isaiah
Isaiah 2025년 4월 4일
I recently remade the app using the single pannel as opposed to the double panel which i had used above. And that seem to work without any issues. I'm gonna run with this solution for my time sake, but I apperciate the help a lot. Thank you.

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

답변 (0개)

카테고리

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

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by