图像处理基于matlab GIF生成含Matlab源码 623期
Posted 紫极神光
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了图像处理基于matlab GIF生成含Matlab源码 623期相关的知识,希望对你有一定的参考价值。
一、简介
基于matlab gif图片的生成
二、源代码
% session 1
% convection and diffusion in 2D!!
% small initialization
clear all
clf
syms x m
% finding am
L = 50;
f = sin(pi*x*m/L);
a1 = 2/L*int(x*f,x,[0,1]);
a2 = 2/L*int((2-x)*f,x,[1,2]);
am = a1 + a2;
% from sym2double
clear x
m1 = 1:100;
am1 = double(subs(am,m,m1));
% space discretization
dx = -2:0.25:10;
dy = 1:20;
[xx,yy] = meshgrid(dx,dy);
% preallocation
phi = zeros(1,size(dx,2));
phi2D = zeros(size(dy,2),size(dx,2));
% time loop
for t = 0:0.1:10
clf
n = 1;
% calculate phi
for x = dx
% convection (comment if other option used)
% phi(n) = sum(am1.*sin(m1*pi*(x-t)/L));
% diffusion (comment if other option used)
% phi(n) = sum(am1.*exp(-0.1*(m1*pi/L).^2*t).*sin(m1*pi*(x)/L));
% convection & diffusion (comment if other option used)
phi(n) = sum(am1.*exp(-0.1*(m1*pi/L).^2*t).*sin(m1*pi*(x-t)/L));
n = n+1;
end
% create phi matrix
for y = dy
phi2D(y,:) = phi;
end
% plot 1D line (comment if plot 2D is used)
% plot(dx,phi)
% axis([min(dx) max(dx) -1 1])
% plot 2D surface (comment if plot 1D is used)
surface(xx,yy,phi2D)
axis([min(dx) max(dx) min(dy) max(dy) -1 1])
% some other plot options
title(sprintf(\'Simulation time = %f s\', t))
xlabel(\'x\'); ylabel(\'y\'); zlabel(\'z\')
grid on
rotate3d on
% view(0,90) % view from above
view(3)
pause(0.01)
三、运行结果
四、备注
版本:2014a
完整代码或代写加1564658423
以上是关于图像处理基于matlab GIF生成含Matlab源码 623期的主要内容,如果未能解决你的问题,请参考以下文章
图像检测基于matlab LSD直线检测含Matlab源码 1697期
图像重建基于matlab卷积神经网络的图像超分辨率重建含Matlab源码 1816期
图像加密基于matlab RSA图像加密解密含Matlab源码 1442期
光学基于matlab GUI光栅条纹投影生成含Matlab源码 2118期