本文介绍了如何使用Matlab制作0和1的对角线分频器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我想要的结果。
分辨率为 256 x 256
。
This is the result that I want.The number of bits resolution are 256 x 256
.
// assign default background to white.
img = ones(256, 256);
示例结果:
0 1 1 1
0 0 1 1
0 0 0 1
0 0 0 0
有没有办法可以使用 zeros()
和 ones()
函数在MATLAB中实现这个结果?我应该如何进行循环?
Is there a way that I can use the zeros()
and ones()
function in MATLAB to achieve this result? How should I do the looping?
结果是 eye()
函数可以做的事情,但它只是做一条对角线。我想要一条分开0和1的对角线。
The result is something that eye()
function can do, but it only do a diagonal lines. I want a diagonal lines that separate zeros and ones.
推荐答案
您正在寻找功能
You are looking for the triu
function
img = triu( ones( 256 ), 1 );
这篇关于如何使用Matlab制作0和1的对角线分频器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!