Matlab编程

Matlab编程,第1张

通常,读取的大多数图像均为8bit,当这些图像加载到内存中时,Matlab就将其存放在类uint8中。此为Matlab还支持16bit的PNG和TIF图像,当读取哪雀这类文漏缓绝件时,Matlab就将其存贮在uint16中。

注意:对于索引图像,即使图像阵列的本身为类uint8或类uint16,imread函数仍将颜色映象表读取并存贮到一个双精度返姿的浮点类型的阵列中

Fizeau干涉仪由于具有参考光与测试光共光程的优点成为多数干涉仪采用的结构形式,对于干涉仪的结构及其影响因族祥素在理论上已进行了肢唯较广泛的研兆饥搏究。但如何对Fizeau干涉仪进行仿真是干涉仪检测所面临的问题。本文首先简要介绍Fizeau干涉仪及相位解包裹的基本原理并利用Matlab编写了基于矩形域的解包裹程序。

在Matlab下输入:edit,然后余态将下面两行百分号之间的内容,复制进去,保存

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [d,r1]=floyd1(vx,vy)

b=inf

a=[0 2 8 1 b b b b

2 0 6 b 1 b b b

8 6 0 7 5 1 2 b

1 b 7 0 b b 9 b

b 1 5 b 0 3 b 8

b b 1 b 3 0 4 6

b b 2 9 b 4 0 3

b b b b 8 6 3 0 ]

d=a

vx=vx+1

vy=vy+1

global r

r=a

for i=1:8

for j=1:8

d(i,j)=a(i,j)

r(i,j)=j

k=1

end

end

for k=1:8

for i=1:8

for j=1:8

if d(i,k)+d(k,j)<d(i,j)

d(i,j)=d(i,k)+d(k,j)

r(i,j)=k

end

end

end

end

r1=r-1

fun3(vx,vy)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

在Matlab下输入:edit,然后将下面两行百分号告团之间的内容,复制进去,保存

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function fun3(vx,vy)

global r

t=r(vx,vy)

if vy==t

return

else

fun3(vx,t)

disp(t-1)

fun3(t,vy)

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

返回matlab 输入:

[d,r1]=floyd1(1,3) %这袜毁橘里我也不知道什么意思。但是能运行就是了。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/8239213.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-14
下一篇 2023-04-14

发表评论

登录后才能评论

评论列表(0条)

保存