Code covered by the BSD License  

Highlights from
MATLAB para Programadores C/C++

image thumbnail
from MATLAB para Programadores C/C++ by Elia Matsumoto
Webinar's slides and demo files.

vsunitcircle(data_real1, data_imag1)
function vsunitcircle(data_real1, data_imag1)
%VSUNITCIRCLE(DATA_REAL1,DATA_IMAG1)
%  data_real1:  vector of real data
%  data_imag1:  vector of imaginary data
%
% mcc -l -o libvsunitcircle vsunitcircle.m -vN

theta = linspace(0,2*pi,100);
x1    = sin(theta)  ;
y1    = cos(theta)  ;

% Create data for the second plot
data_abs1   = abs(data_real1+data_imag1*i);
data_ind1   = 1:length(data_abs1);

%  Auto-generated by MATLAB on 05-Sep-2006 08:34:04

%% Create figure
figure1 = figure(1);
delete(get(gcf,'Children'));

%% Create axes
axes1 = axes('Parent',figure1,'YGrid','on','XGrid','on',...
    'Position',[0.13 0.11 0.5797 0.815],...
    'PlotBoxAspectRatio',[1.5 1.5 1],...
    'DataAspectRatio',[1 1 1]);
axis(axes1,[-1.5 1.5 -1.5 1.5]);
box('on');
hold('all');

%% Create plot
plot(x1,y1,'DisplayName','y1 vs x1','Parent',axes1);

% Create xlabel
xlabel('Real');

% Create ylabel
ylabel('Imag');

%% Create plot
plot(data_real1,data_imag1,'DisplayName','data_imag vs data_real',...
    'Parent',axes1,...
    'Marker','o',...
    'LineStyle','none');

% Create axes
axes2 = axes('Parent',figure1,'Position',[0.7987 0.11 0.1063 0.815]);
xlim(axes2,[0.5 1.5]);
box('on');
hold('all');

%% Create plot
plot(data_abs1,data_ind1,'DisplayName','data_ind vs data_abs',...
    'Parent',axes2,...
    'Marker','o', ...
    'color', [0 0.498 0]);

% Create xlabel
xlabel('Magnitude');

Contact us at files@mathworks.com