matlab大括号妙用.docx
- 文档编号:24777772
- 上传时间:2023-06-01
- 格式:DOCX
- 页数:18
- 大小:16.72KB
matlab大括号妙用.docx
《matlab大括号妙用.docx》由会员分享,可在线阅读,更多相关《matlab大括号妙用.docx(18页珍藏版)》请在冰豆网上搜索。
matlab大括号妙用
其实在matlab中大括号用的也不是很多,反而单引号和中括号用的相对多些,我所看到的主要有下面这些情况:
1.在定义几个变量或字符串时如:
1.student=struct('name',{'Annie'},'scores',{70,89,100,45})定义构架函数
2.A={[1,4,3;0,5,8;7,2,9]}%定义元胞数组
3.prompt={'Entermatrixsize:
','Entercolormapname:
'};
title='Inputforpeaksfunction';
lines=1;
def={'20','hsv'};
answer=inputdlg(prompt,title,lines,def);%定义输入信息对话框
2.定义某一图形或其他对象属性时:
(%统计图形,分位点)
clf;
v=4;
p=0.95;
q=chi2inv(p,v);
x=0:
0.1:
15;
kf_4=chi2pdf(x,v);
plot(x,kf_4,'b'),holdon
xxf=0:
0.1:
q;
yyf=chi2pdf(xxf,v);
fill([xxf,q],[yyf,0],'g')
text(q*1.01,0.01,num2str(q))
text(10,0.16,['fontsize{16}x~{chi}^2''
(4)'])
text(1.5,0.08,'fontname{隶书}fontsize{22}置信水平0.95')
text(12,0.008,'downarrow','fontsize',22)
text(11,0.03,'fontname{隶书}fontsize{22}拒绝域')
再看下面的程序
fork=1:
12
L{k}=membrane(k);
End
输出:
L{1}
ans=
Columns1through3
-0.579956-0.3667-0.9197
-0.760285-0.768471-0.162699
-0.7062-0.131486-0.041892
-0.375297-0.019-0.119129
0...376871
0...872688
0..00560.439
0...348
0.1720..937895
0.1180..284093
0.1890.0600.3784
0...679192
0...111
0...617344
0...870065
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
Columns4through6
-0.338-0.642087-0.154
-0.661571-0.287648-0.942669
-0.888635-0.06770.7201
0...574288
0..81140.047051
0...478900
0..64700.463595
0...811951
0...285325
0...140137
0...057390
0...237275
0.7310.1670.631
0..1.741
0..0583.058197
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
Columns7through9
-0.-0.868880-0.097
-0.773346-0..924935
0.48780..352390
0.1010.7140.826111
0.8870..799190
0...285190
0...303334
0..3727.691287
0.75740..075677
0...111364
0...209873
0...691799
0.2580..098599
0...166233
0.70410..236872
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
Columns10through12
-0.654384-0.789209-0.012
0.0354..100
0...547719
0...699143
0...221638
0...804309
0...698115
0...990340
0.54700..649
0...095368
0.4470.
0..516418
0.3150.852729
0.2179.455961
0..824741
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
Columns13through15
0..849162
0.9860.628604
0.2560.852206
0..600890
0.35600.691397
0..6362
0..275879
0.40110.448426
0..368898
0..285618
0.6960.483056
0..584653
0...314166
0.921820
0.245592
0.1339
0.000000
0.626070
0.254
0.757946
0.099
0.848174
0.101655
0.898724
0.209991
0.761550
0.440343
0.748
0.5012
0.534628
0...614959
0..42850.525817
000
000
000
000
000
000
000
00
00
00
00
00
00
00
00
00
Columns16through18
0..1527
0..914
0..628012
0..088725
0..689
0..9852
0.7650.605764
0.8700.930740
0.87770.998422
0..738452
0.640.017109
0..293721
0.3490.920140
0..909245
0..051634
00.966391
00.525817
00.4285
00.385512
00.038710
00.824741
00.298109
00.236872
00.720749
00.00000
0.091033
0.291148
0.469550
0.162321
0.241446
0.891103
0.327517
0.649943
0.535130
0.013238
0.939017
0.879
0.974702
0.917734
0.909245
0.898770
0.614959
0.458867
0.211042
0.1339
0.455961
0.727621
0.166233
0.201517
0.051637
00..741
00.0583.150
00..561431
00..617344
00..662544
00..241871
Columns19through21
0..0845.317580
0...636404
0..6911
0..6978
0.89470.388693
0..041584
0..570155
0..123366
0..921448
0.59110.118833
0.57250.830584
0..843639
0..465366
0..879
0..293721
0.3490.782165
0..5012
0..584653
0..219774
0..921820
0..516418
0.3150.023465
0..691799
0..133026
0.2580.872040
0.6310.237275
0.1670.167054
0.7310.167835
0.1110.679192
0..075283
0..378703
Columns22through24
0..726435
0..399102
0.3050.0285
0..7654
0...624898
0.718666
0.960313
0.665716
0.861
0.064733
0.005266
0.944806
1.
0.830584
0.5725
0.939017
0.017109
0.64
0.748
0.483056
0.696
0.314166
0.
0.726816
0.209873
0.583356
0.635047
0.057390
0.909818
0.269758
0.3784
0.060
0.189
-0.329591
0.112172
0.2255
0.067053
0.183949
0.6860.6310.742760
0...663
0...416197
0...996484
0.9650..876616
0...064733
0...123366
0.59110..445552
0...649943
0...930740
0..87770.870
0...209991
0...448426
0...4011
0..6490.990340
0...481376
0..54700.736798
0...691287
0...708098
0..75740.339353
0..2873.811951
0...241799
0...857340
0...348
0...438412
0.1180.1720.539289
Columns25through27
-0.838538-0.912718-0.667
0.736710-0.395211-0.446668
0...309195
0..11180.256405
0...622829
0...391225
0.43750..230357
0.6630..183949
0..6310.945563
0..6860.515820
0.8610..960313
0...388693
0...8947
0...241446
0..98520.689
0.7650..695232
0...848174
0..63620.691397
0...356000
0...221638
0...050495
0...367180
0...799190
0...942150
0...887
0...047051
0.64700..8114
0...747100
0.4390..376871
0.00560..840981
0...608420
Columns28through30
-0.713635-0.258-0.773952
-0.086137-0.185-0.536943
-0.007765-0.083785-0.185
0.425224-0.007765-0.086137
0..309195-0.446668
0.11180.599888-0.395211
0...736710
0..22550.112172
0.76540.02850.399102
0..3050.569984
0...636404
0.69780.69110.227424
0...188966
0...291148
0...914
0...207659
0.0990..254
0...628604
0..2560.986
0...100
0...566343
0...899437
0...924935
0.7140.465907-0.326240
0.1010.4878-0.773346
0..7201-0.942669
0.509305-0.0677-0.287648
0.212612-0.888635-0.661571
-0.119129-0.041892-0.162699
-0.019-0.131486-0.768471
-0.375297-0.7062-0.760285
Column31
-0.159913
-0.773952
-0.258
-0.713635
-0.667
-0.912718
-0.838538
-0.329591
0.726435
0.035934
0.317580
0.524891
0.684023
0.091033
0.1527
0.236199
0.626070
0.849162
0.899589
-0.012
-0.789209
-0.654384
-0.097
-0.868880
-0.
-0.154
-0.642087
-0.338
-0.9197
-0.3667
-0.579956
可任意将数据修改为字符数组以及其它类型的数组
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- matlab 括号 妙用