cellplot绘图
c{1,1}="2-by-2";
c{1,2}="eigenvalues of eye(2)";
c{2,1}=eye(2);
c{2,2}=eig(eye(2));
cellplot(c)
function testplot
t=0:pi/50:10*pi;
plot3(sin(t),cos(t),t)
axis square
grid on
在命令行输入:mcc -m testplot.m
生成testplot.exe后,点击testplot.exe生成如下图形:
利用line函数绘制曲线
clear;
close all;
t=linspace(0,pi*2,401);%生成等间距采样点
subplot(131)
line(t,t.*sin(t*2),'LineStyle','-','Color','k');%绘制二外曲线
axis square; %设定坐标轴为方形
xlim([min(t),max(t)]); %设置x轴显示的数据范围
subplot(132);
line(t.*sin(4*t),t.*cos(4*t),t,'LineStyle','-','Color','k');%绘制三维曲线
axis square; %设定坐标轴为方形
subplot(133);
line(t.*sin(4*t),t.*cos(4*t),t,'LineStyle','-','Color','k');%绘制三维曲线
view(3); %三维视图
axis square;%设定坐标轴为方形
set(gcf,'Color','w');
clear all;
b=bar(rand(10,5),'stacked');%以堆栈方式画长条图
colormap(summer);%设置颜色映像值
hold on;%保持图形
x=plot(1:10,5*rand(10,1),'marker','square','MarkerSize',12,'MarkerEdgeColor','m',...
'MarkerFaceColor',[0.5,0,0.5],'LineStyle',':','Color','b','LineWidth',3);
hold off
详解MATLAB图形绘制技术—张德丰,雷小平主编;周燕副主编;[M]北京:电子工业出版社