Changing variables in different functions

1 回表示 (過去 30 日間)
Luke Dineen-Woolnough
Luke Dineen-Woolnough 2016 年 3 月 4 日
コメント済み: Walter Roberson 2016 年 3 月 5 日
Im trying to change a variable in one function using a separate slider function, I've managed to get the slider to change its current amount from 0 to 255, however it wont seem to assign this value to the variable i want to change. can anyone suggest what im doing wrong?
Code Below
Kind Regards
Luke
function f = slider(hObject,Reassign, ~, h)
set(h.buttonfour, 'Max', 255, 'Min', 0);
current = get(hObject, 'Value');
assignin('base', 'current', current);
set(Reassign(C ==3), 'Value', current);
%%Variable i want to change Reassign(C ==3), ive only used reassign atm as im unsure how to properly syntax Reassign(C ==3) as a variable.
Reassign = C;
Reassign(C == 1) = 10;
Reassign(C == 2) = 80;
Reassign(C == 3) = 210;
%%CallBack
set(h.buttonfour, 'callback', {@slider, Reassign(C == 3), h});
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 3 月 5 日
What is C here?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by