create variables' name in pattern
显示 更早的评论
n0=imread('0.png')
n1=imread('1.png')
n2=imread('2.png')
n3=imread('3.png')
...
How can i create names in some patterns i prefer. And excute some non-number syntaxs like <imread('3.png')> in some patterns. Because '3' in '3.png' is not a number but a string, i cant use <for loop> for it.
I know someone may say and has said that you can use matrix.
This creats a 4-D matrix, because image itself is 3-D, and you need an additional dimension to indicate "where we put it", and it can use <for loop> due to indicators in 4-D matrix N( , , ,1) are numbers.
Creating 4-D matrix make the whole thing felt wierd and complicate. And you need to be sure the size for each image is the same so they can be fixed in 4-D matrix you create.
So far , how to name it is somehow tackled by this 4-D matrix, but what about right side <imread('3.png')>? how ?
And i dont like the method mentioned.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!