Interactive plot change with few sliders

3 ビュー (過去 30 日間)
iMatten
iMatten 2019 年 1 月 26 日
Hello everyone,
I have a question about controling plot change from a few sliders. At the moment I am doing it by pushing button in GUI. I wanted to solve the problem without pushed button. So I can control sliders to change plot without confirming it everytime with pushing button. I would appreciate any suggestions. Im writing it in App Designer.
Here is my code:
% Button pushed function: KolorujButton
function KolorujButtonPushed(app, event)
w_1 = app.w_1Slider.Value * pi/255; %1st slider
w_2 = app.w_2Slider.Value * pi/255; %2nd slider
w_3 = app.w_3Slider.Value * pi/255; %3rd slider
th_1 = app.th_1Slider.Value*pi/180; %4th slider
th_2 = app.th_2Slider.Value*pi/180; %5th slider
th_3 = app.th_3Slider.Value*pi/180; %6th slider
k = [1,1,1];
a = [0,0,0];
map = zeros(256,3);
x = 1:256;
map(:,1) = abs(a(1)+k(1)*(cos(w_1*x + th_1))); %creating a functions with data collected from a slider
map(:,2) = abs(a(2)+k(2)*(cos(w_2*x + th_2)));
map(:,3) = abs(a(3)+k(3)*(cos(w_3*x + th_3)));
plot(app.Axes, map); %showing functions on plot
end

回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by