![]() |
请教一个循环
Loop1 = 1:20
size(Label(find(Label==Loop1)),1) 一共是20个类别。其中,Label对应的是每个图像的标记,为1,1,1,1,...,2,2,2,...,20,20,...,20 本意是分别找出:Label=1, Label=2, ..., Label=20中sample的个数。 自己写了一个循环,是错的:( for Loop1 = 1:20 for Loop2 = 1:size(Label(find(Label==Loop1)),1) ... end end 有请高手们出招~:p |
回复: 请教一个循环
lz 不是非常理解你这句话的意思?
Label=1:20 for Loop1 = 1:20 for Loop2 = 1:size(Label(find(Label==Loop1)),1) ... end end 我按照这样写不知道是否和你的意思匹配 没有错误提示? |
回复: 请教一个循环
Label是个列向量
Label = [1,1,1,...,1; 2,2,2,...,2; 3,3,3,...,3; ...; 20,20,20,...,20] [QUOTE=silas_xue;27125]lz 不是非常理解你这句话的意思? Label=1:20 for Loop1 = 1:20 for Loop2 = 1:size(Label(find(Label==Loop1)),1) ... end end 我按照这样写不知道是否和你的意思匹配 没有错误提示?[/QUOTE] |
所有时间均为北京时间。现在的时间是 14:51。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.