Можно ли экспортировать интерактивные фигуры MATLAB в HTML? - PullRequest
0 голосов
/ 27 августа 2018

Я хотел бы экспортировать интерактивную фигуру, которая содержит полосу прокрутки, в HTML или что-то подобное; так что конечный пользователь, у которого нет MATLAB, может использовать фигуру в интерактивном режиме.

Не уверен, возможно ли это или нет.

Я нашел несколько функций, относящихся к трехмерным графикам, однако ни одна из них не подходит для типа фигуры, которую я пытаюсь экспортировать.

Пример кода:

% Generate and plot data    
x=0:1e-2:2*pi;
y=sin(x);
dx=2; % dx is the width of the axis 'window'   

a=gca;
p=plot(x,y);

% Set appropriate axis limits and settings    
set(gcf,'doublebuffer','on');

%% This avoids flickering when updating the axis    
set(a,'xlim',[0 dx]);    
set(a,'ylim',[min(y) max(y)]);

% Generate constants for use in uicontrol initialization
pos=get(a,'position');
Newpos=[pos(1) pos(2)-0.1 pos(3) 0.05];

%% This will create a slider which is just underneath the axis    
%% but still leaves room for the axis labels above the slider   
xmax=max(x);    
S=['set(gca,''xlim'',get(gcbo,''value'')+[0 ' num2str(dx) '])'];

%% Setting up callback string to modify XLim of axis (gca)    
%% based on the position of the slider (gcbo)    
% Creating Uicontrol
h=uicontrol('style','slider',...
            'units','normalized','position',Newpos,...
            'callback',S,'min',0,'max',xmax-dx);
...