Crunch Time - User Interface Set Variable

3 ビュー (過去 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 Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by