Crunch Time - User Interface Set Variable

조회 수: 1 (최근 30일)
Thomas
Thomas 2014년 4월 11일
답변: Walter Roberson 2014년 4월 11일
Hi Everyone, I have been working on this code for weeks and finally have gotten it to work but can't manage to create a user interface. Essentially I have a bunch of matlab code written with one being the following:
a = 4;
b = 5;
c = 12;
chord = 1;
angle = 40;
npoints = 500;
[naca1,naca2,naca3, naca4] = Naca4( a,b,c, chord,angle*pi/180, npoints);
figure(1);
hold on;
axis fill;
title(['Naca ',num2str(a),num2str(b),num2str(c)]);
plot(naca1(:,1),naca1(:,2),'r',naca2(:,1),naca2(:,2),'g');
plot(naca3(:,1),naca3(:,2),'b',naca4(:,1),naca4(:,2),'b');
axis equal;
The code above creates a figure from a b and c. Everything works except this.
I am trying to create a user interface where someone could define a b and c and see the resulting graph. I have tried watching countless GUI tutorials but I don t seem to be managing to understand how it works.
Any help would be appreciated.

답변 (1개)

Walter Roberson
Walter Roberson 2014년 4월 11일
inputdlg() . And remember to convert the resulting strings to numeric values with str2double()

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by