Changing variables in different functions
1 回表示 (過去 30 日間)
古いコメントを表示
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});
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!