Crunch Time - User Interface Set Variable

1 次查看(过去 30 天)
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 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by