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 个评论

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!

Translated by