Assign value to slider in GUI from other M-files

2 vues (au cours des 30 derniers jours)
Cheng Yoong
Cheng Yoong le 13 Nov 2011
I have a GUI that contain two sliders. Then I created a seperate M-file roughly like this:
function [theta1,theta2] = inverse(positionX,positionY)
.
.
.
theta1=..
theta2=..
how can i assign the theta1 and theta2 to the respective sliders?

Réponses (1)

Walter Roberson
Walter Roberson le 13 Nov 2011
You set() the Value property of the slider handle to the new value. Depending on how you use the function, this might require passing the slider handles in to the function (or using findobj() to fetch the handles of the sliders.)
  1 commentaire
Cheng Yoong
Cheng Yoong le 13 Nov 2011
Can you give me example?I'm still new to Matlab.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Robotics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by