24小时热门版块排行榜    

查看: 2379  |  回复: 5
本帖产生 1 个 博学EPI ,点击这里进行查看

tjbbg18

新虫 (小有名气)

[求助] MATLAB 2016a进度条对象获取和设置问题

ha1=get(hrand,'Children');
hac=get(ha1,'Children');
hapa=findall(hac,'Type','patch')
set(hapa,'FaceColor','k')
这个程序在2014a以前都可设置进度条的颜色,我换成MATLAB2016a之后,
hac=get(ha1,'Children');运行显示 0x0 empty GraphicsPlaceholder array.;
而且set也不能设置颜色了,望指教
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
回帖置顶 ( 共有1个 )

FMStation

至尊木虫 (知名作家)

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★ ★ ★ ★
tjbbg18: 金币+10, 博学EPI+1 2016-08-27 18:15:00
https://stackoverflow.com/questions/36352171/change-width-of-the-bar-figure-at-waitbar-matlab-r2015a
CODE:
% Create a progress bar.
hBar = waitbar ( 0, 'Please Wait....' );
% now use java to get to the progress bar
jFrame = get ( hBar, 'JavaFrame' ); % this will throw a warning
jFigPanel = jFrame.getFigurePanelContainer;
% Now go down through the children of the panel to get the container for the progress bar
jContainer = jFigPanel.getComponent(0);
jPanel = jContainer.getComponent(0);
% Change the location of the panel (ref pixels)
jPanel.setLocation(0,40);
% Change the size of the panel
jPanel.setSize(360,18);
% You then need to repaint and validate for the update to be visible.
jContainer.repaint
jContainer.revalidate

6楼2016-08-27 13:51:58
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通回帖

FMStation

至尊木虫 (知名作家)

【答案】应助回帖

https://www.mathworks.com/help/m ... r-some-objects.html

Why Is the Children Property Empty for Some Objects?
Starting in R2014b, these objects do not contain handles to underlying objects in their Children properties. To customize the graph, use properties of the actual object. This table lists the affected objects.
2楼2016-08-25 22:38:26
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

tjbbg18

新虫 (小有名气)

引用回帖:
2楼: Originally posted by FMStation at 2016-08-25 22:38:26
https://www.mathworks.com/help/matlab/graphics_transition/why-is-the-children-property-empty-for-some-objects.html

Why Is the Children Property Empty for Some Objects?
Starting in R2014b, these o ...

这个我也查了,我是想知道在2016a中如何设置啊,可否告知
3楼2016-08-26 21:17:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

FMStation

至尊木虫 (知名作家)

【答案】应助回帖

Use colorbar properties to modify the colorbar.
https://www.mathworks.com/help/matlab/ref/colorbar-properties.html
CODE:
c = colorbar;
w = c.LineWidth;
c.LineWidth = 1.5;

4楼2016-08-26 21:32:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

tjbbg18

新虫 (小有名气)

引用回帖:
4楼: Originally posted by FMStation at 2016-08-26 21:32:38
Use colorbar properties to modify the colorbar.
https://www.mathworks.com/help/matlab/ref/colorbar-properties.html


c = colorbar;
w = c.LineWidth;
c.LineWidth = 1.5;

hrand=waitbar(0.3,'颜色')
ha1=get(hrand,'Children');
hac=get(ha1,'Children');
hapa=findall(hac,'Type','patch')
set(hapa,'FaceColor','r')
我还是不懂,就是您能否设置一下进度条的颜色hrand=waitbar(0.3,'颜色'),在2016a中,这个程序在2014a以前都可以把进度条颜色设置为红色,但是2016a中帮助文档说是colorbar但是我还是不会设置进度条啊
5楼2016-08-27 11:11:24
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 tjbbg18 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考博] 上海工程技术大学激光智能制造课题组招收博士研究生 +6 两三岁ss 2026-09-14 6/300 2026-09-15 20:17 by 只吃肉葡萄
[考研] 售SCI一区文章,我:8O5.5.1.O5.4,科目全,可伽急 +3 0pYnUiPDfdnk 2026-09-14 3/150 2026-09-15 19:35 by CgyNCDVNhGVg
[博后之家] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +3 40ms4Wlo4umh 2026-09-14 3/150 2026-09-15 19:23 by CgyNCDVNhGVg
[找工作] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +3 23jxep3nCNZb 2026-09-14 3/150 2026-09-15 18:47 by CgyNCDVNhGVg
[博后之家] 售SCI一区文章,我:8O5.5.1.O5.4,科目全,可伽急 +3 6F5UbRU2I5hL 2026-09-14 3/150 2026-09-15 17:59 by CgyNCDVNhGVg
[考研] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +4 6F5UbRU2I5hL 2026-09-14 4/200 2026-09-15 17:23 by CgyNCDVNhGVg
[考研] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +3 6F5UbRU2I5hL 2026-09-14 3/150 2026-09-15 17:15 by CgyNCDVNhGVg
[博后之家] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +3 s3fFTmArrBt6 2026-09-14 5/250 2026-09-15 16:50 by CgyNCDVNhGVg
[考博] 售SCI文章,我:8O.5.5.1O.54,科目全,可十急 +6 3n8v2C8RimXI 2026-09-13 6/300 2026-09-15 14:38 by VMDqgnlKimtZ
[考博] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +6 QUjhNVAcOSff 2026-09-13 6/300 2026-09-15 14:25 by VMDqgnlKimtZ
[博后之家] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +6 QUjhNVAcOSff 2026-09-13 7/350 2026-09-15 14:13 by VMDqgnlKimtZ
[博后之家] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +3 s3fFTmArrBt6 2026-09-14 3/150 2026-09-15 07:34 by C79jjtjAKjEn
[考研] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +3 s3fFTmArrBt6 2026-09-13 5/250 2026-09-15 06:49 by 5BDX0d0WFp7t
[考研] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +4 LwdutQ8HoqWP 2026-09-13 4/200 2026-09-15 06:14 by 5BDX0d0WFp7t
[找工作] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +6 QUjhNVAcOSff 2026-09-13 7/350 2026-09-15 05:22 by 5BDX0d0WFp7t
[博后之家] 售SCI一区文章,我:8O5.5.1.O5.4,科目全,可伽急 +3 s3fFTmArrBt6 2026-09-13 4/200 2026-09-14 23:24 by vZfe6xYu34yj
[找工作] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +3 QUjhNVAcOSff 2026-09-13 5/250 2026-09-14 21:25 by vZfe6xYu34yj
[找工作] 浙江师范大学是怎么坑我的 +6 recruit123 2026-09-09 6/300 2026-09-14 12:00 by 萨仁其其格
[考博] 西北工业大学材料学院电化学传感与催化课题组招收2027年推免研究生、博士生、博士后 +3 马方园 2026-09-10 4/200 2026-09-14 09:29 by Chem张zz
[教师之家] 浙江师范大学是怎么坑我的 +10 recruit123 2026-09-09 15/750 2026-09-13 10:45 by seaskyy
信息提示
请填处理意见