surfplot uicontrol, updateSystem failure
이전 댓글 표시
Hello,
I'm trying to create a surfplot with sliders that will update the input values of the system.
The values for the X and Y axis remain constant but a certain parameter is changed to change the outcome in the Z domain. I have used
TEST_function(PARAM_1); %This calculates X_vector, Y_vector and Z_array
f = figure;
ax = axes('Parent',f,'position',[0.13 0.39 0.77 0.54]);
h = surf(X_vector,Y_vector,Z_array);
b = uicontrol('Parent',f,'Style','slider','Position',[81,54,419,23],...
'value',PARAM_1, 'min',1, 'max',30);
bgcolor = f.Color;
bl1 = uicontrol('Parent',f,'Style','text','Position',[50,54,23,23],...
'String','1','BackgroundColor',bgcolor);
bl2 = uicontrol('Parent',f,'Style','text','Position',[500,54,23,23],...
'String','30','BackgroundColor',bgcolor);
bl3 = uicontrol('Parent',f,'Style','text','Position',[240,25,100,23],...
'String','PARAM_1','BackgroundColor',bgcolor);
b.Callback = @(es,ed) updateSystem(h,TEST_function(es.Value));
When I run the file, Matlab returns the following error:
Undefined function 'updateSystem' for input arguments of type 'matlab.graphics.chart.primitive.Surface'.
Error in TEST>@(es,ed)updateSystem(h,TRANSFER_TEST(es.Value))
Error while evaluating UIControl Callback
I think it has something to do with the surf plot but I'm not able to figure out exactly what it is.
Regards, Mark.
댓글 수: 1
Tejas
2016년 3월 23일
The documentation for 'updateSystem' seems to indicate that 'updateSystem' is expecting a 'handle' object that is mostly the output of a response plot command.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!