Professional Documents
Culture Documents
2015
---------- IF-ELSE ----------1) Programul afiseaza un numar pozitiv/negativ sau zero
>> x = 1
x =
1
>> X =input ('x =');
x = 1
>> if x>0
fprintf('x este numar pozitiv\n')
else
fprintf ('x este numar negativ sau zero\n')
end
x este numar pozitiv
--------- IF-ELSE-IF ----------2)>> u = input ('u=');
u=2
>> v = input ('v=');
u=1
>> if u>v
frintf ('u este mai mare ca v\n')
v = input ('v=');
else if u<v
frpintf ('u este mai mic ca v\n')
end
3)>> culoare = input ('Tastati o culare:','s');
Tastati o culare:rosu
>> switch culoare
case 'rosu'
disp ('Culoarea este rosu')
case 'galben'
disp ('Culoarea este galbena')
case 'albastru'
disp ('Culoarea este albastru')
otherwise
disp ('Este alta culoare')
end
Culoarea este rosu
>>
>> culoare = input ('Tastati o culare:','s');
Tastati o culare:roz
>> switch culoare
case 'rosu'
disp ('Culoarea este rosu')
case 'galben'
disp ('Culoarea este galbena')
case 'albastru'
disp ('Culoarea este albastru')
otherwise
----------FOR IMBRICAT---------5)>> m = 5;
n =8;
for i=1:m %se repeta de m ori
for j = 1:n %se repeta de n ori
B(i,j)=1/(i+j-1);
end
end
>> B
11
B =
1.0000
0.5000
0.3333
0.2500
0.2000
0.5000
0.3333
0.2500
0.2000
0.1667
0.3333
0.2500
0.2000
0.1667
0.1429
0.2500
0.2000
0.1667
0.1429
0.1250
0.2000
0.1667
0.1429
0.1250
0.1111
0.1667
0.1429
0.1250
0.1111
0.1000
0.1429
0.1250
0.1111
0.1000
0.0909
0.1250
0.1111
0.1000
0.0909
0.0833
-----------END----------------11.05.2015
2)
--------------Afiseaza cod ASCII------------>> c = 'Universitatea Baia Mare'
c =
Universitatea Baia Mare
>> e = double(c)
e =
85
32
116
101
97
116
101
97
>> g = char(e)
g =
Universitatea Baia Mare
>> e = double(c) %afiseaza codul ASCII al literelor
e =
85
32
70
116
32
100
101
32
114
101
97
99
10
13
10
>> b = 1:15
b =
1
14
2
15
>> c = 14:-2:4
c =
14
12
>> x = linspace(17,58,4)
x =
17.0000
30.6667
44.3333
58.0000
10
11
12
13
>> y = linspace(pi,-pi,6)
y =
3.1416
1.8850
0.6283
-0.6283
-1.8850
-3.1416
6.9798
22.8990
8.9697
24.8889
10.9596
26.8788
12.9495
28.8687
14.9394
30.8586
16.9293
32.8485
44.7879
60.7071
46.7778
62.6970
48.7677
64.6869
50.7576
66.6768
52.7475
68.6667
80.6061
96.5253
>> w = linspace(3,200)
w =
Columns 1 through 18
3.0000
18.9192
34.8384
4.9899
20.9091
36.8283
Columns 19 through 36
38.8182
54.7374
70.6566
40.8081
56.7273
72.6465
42.7980
58.7172
Columns 37 through 54
74.6364 76.6263
90.5556 92.5455
106.4747 108.4646
78.6162
94.5354
Columns 55 through 72
110.4545 112.4444 114.4343 116.4242 118.4141 120.4040 122.3939 124.3838
126.3737 128.3636 130.3535 132.3434 134.3333 136.3232 138.3131 140.3030
142.2929 144.2828
Columns 73 through 90
146.2727 148.2626 150.2525 152.2424 154.2323 156.2222 158.2121 160.2020
162.1919 164.1818 166.1717 168.1616 170.1515 172.1414 174.1313 176.1212
178.1111 180.1010
Columns 91 through 100
182.0909 184.0808 186.0707 188.0606 190.0505 192.0404 194.0303 196.0202
198.0101 200.0000
>> t = logspace(1,2)
t =
Columns 1 through 18
10.0000
14.5635
21.2095
10.4811
15.2642
22.2300
10.9854
15.9986
11.5140
16.7683
12.0679
17.5751
12.6486
18.4207
13.2571
19.3070
13.8950
20.2359
26.8270
39.0694
28.1177
40.9492
29.4705
42.9193
30.8884
44.9843
32.3746
47.1487
Columns 19 through 36
23.2995
33.9322
49.4171
24.4205
35.5648
51.7947
25.5955
37.2759
Columns 37 through 50
54.2868
79.0604
56.8987
82.8643
59.6362
86.8511
0.8622
0.3188
-1.3077
-0.4336
0.3426
3.5784
62.5055
91.0298
65.5129 68.6649
95.4095 100.0000
71.9686
75.4312
>> randn(3)
ans =
0.5377
1.8339
-2.2588
>> D = [1 5 7 ; 3 6 8]
D =
1
3
5
6
7
8
>> randn(D)
??? Error using ==> randn
Size vector must be a row vector with real elements.
>> randn(size(D))
ans =
2.7694
-1.3499
3.0349
0.7254
-0.0631
0.7147
matlab\timefun
matlab\datatypes
matlab\verctrl
matlab\codetools
matlab\helptools
matlab\winfun
DE)
winfun\NET
matlab\demos
matlab\timeseries
matlab\hds
matlab\guide
matlab\plottools
toolbox\local
on.
matlab\datamanager
shared\instrument
coder\matlabcoder
matlabxl\matlabxl
simulink\simulink
simulink\blocks
simulink\components
simulink\fixedandfloat
fixedandfloat\obsolete
simulink\simdemos
simdemos\aerospace
mples.
simdemos\automotive
amples.
simdemos\simfeatures
simdemos\simgeneral
les.
simulink\dee
glue\studio
dastudio\depviewer
stateflow\stateflow
simulink\MPlayIO
shared\hdlshared
rtw\rtw
asap2\asap2
asap2\user
can\blocks
common\tgtcommon
targets\pil
targets\shared
toolbox\simulinkcoder
rtw\accel
blocks\library
fixedandfloat\fxpdemos
simulink\modeladvisor
stateflow\sfdemos
adivdsp\vdspdemos
adivdsp\mdlinfo
adivdsp\tfl
aero\aero
shared\mapgeodesy
aeroblks\aeroblks
aeroblks\aerodemos
aero\astdemos
AUTOSAR\AUTOSAR
bioinfo\bioinfo
bioinfo\biolearning
functions.
bioinfo\microarray
nctions.
bioinfo\mass_spec
a analysis functions.
bioinfo\proteins
s.
bioinfo\biomatrices
coring matrices.
bioinfo\biodemos
examples.
bioinfo\graphtheory
s.
blks\masks
blackfin\blackfindemos
c166\c166
c166\blocks
c166\c166demos
utils\resource_config
shared\can
can\canblks
can\canmasks
can\canmex
coder\codegendemos
coder_foundation\tfl
comm\comm
commutilities\comminit
commutilities\commmex
comm\commutilities
comm\commdemos
comm\commdeprecated
m Toolbox.
comm\examples
shared\comparisons
toolbox\compiler
control\control
control\ctrlguis
ot manipulation.
control\ctrlobsolete
control\ctrlutil
es.
control\ctrldemos
controllib\engine
engine\options
controllib\general
controllib\graphics
controllib\requirements
curvefit\curvefit
curvefit\splines
curvefit\cftoolgui
curvefit\sftoolgui
curvefit\curvefitdemos
shared\optimlib
daq\daq
daq\daqguis
t Instruments.
daq\daqdemos
os.
- Bioinformatics Toolbox
- Bioinformatics Toolbox -- Statistical Learning
- Bioinformatics Toolbox -- Microarray support fu
- Bioinformatics Toolbox -- Mass spectrometry dat
- Bioinformatics Toolbox -- Protein analysis tool
- Bioinformatics Toolbox -- Sequence similarity s
- Bioinformatics Toolbox -- Tutorials, demos and
- Bioinformatics Toolbox -- Graph Theory function
-
file)
file)
file)
file)
file)
file)
file)
file)
file)
file)
file)
file)
Toolbox
file)
file)
file)
Toolbox Demos.
from Communications Syste
shared\dastudio
database\database
database\dbdemos
database\vqb
datafeed\datafeed
datafeed\dfgui
des\desblks
des\desmasks
des\desmex
des\desdemos
toolbox\distcomp
distcomp\distcomp
distcomp\user
distcomp\mpi
distcomp\pctdemos
distcomp\parallel
parallel\util
distcomp\lang
cts.
distcomp\gpu
our computer's graphics
distcomp\worker
dotnetbuilder\dotnetbuilder
dsp\dsp
dsp\dsputilities
dsputilities\dspinit
dsputilities\dspmex
dsp\dspdemos
shared\filterdesignlib
shared\system
dspblks\dspblks
fixedpoint\fixedpoint
dsp\filterdesign
eclipseide\eclipseidedemos
eclipseide\mdlinfo
eclipseide\tfl
econ\econ
econ\econdemos
edalink\edalink
foundation\hdllink
modelsim\modelsim
ModelSim
modelsim\modelsimdemos
incisive\incisive
e
incisive\incisivedemos
discovery\discovery
ery
discovery\discoverydemos
tlmgenerator\foundation
foundation\tlmgeneratordemos
eda\fil
fil\fildemos
eda\fpgaautomation
ation
targets\ecoder
ecoder\ecoderdemos
mpt\mpt
mpt\user_specific
toolbox\embeddedcoder
(No
(No
(No
(No
(No
EDA
eml\eml
toolbox\exlink
finance\finance
finance\calendar
finance\findemos
finance\finsupport
finance\ftseries
finderiv\finderiv
finderiv\finderivdemos
finfixed\finfixed
finfixed\finfixdemos
fixedpoint\fidemos
fixedpoint\fixedpointtool
shared\spcuilib
shared\siglib
toolbox\fixpoint
fpgaautomation\fpgademos
fuzzy\fuzzy
fuzzy\fuzdemos
fuzzy\fuzzyutil
geoweb\geoweb
ghsmulti\multidemos
ghsmulti\mdlinfo
ghsmulti\tfl
globaloptim\globaloptim
globaloptim\globaloptimdemos
hdlcoder\hdlcoder
hdlcoder\hdlcoderdemos
hdlfilter\hdlfilter
hdlfilter\hdlfiltdemos
iarew\iarewdemos
iarew\mdlinfo
foundation\pjtgenerator
pjtgenerator\hookpoints
pjtgenerator\tgtpref2
pjtgenerator\mdlinfo
pjtgenerator\blks
blks\masks
blks\utils
foundation\util
foundation\errorhandler
lfsocket\lfsocket
foundation\xmakefile
idelink\idelinkdemos
ident\ident
ident\nlident
"help ident" for more info.
ident\idobsolete
ident\idguis
ident\idutils
ident\iddemos
iddemos\examples
images\colorspaces
images\images
images\imdemos
mages
images\imuitools
images\iptformats
images\iptutils
shared\imageslib
Image
Image
Image
Image
Processing
Processing
Processing
Processing
Toolbox
Toolbox
Toolbox
Toolbox
--- imuitools
--- File Formats
--- utilities
Library
imaq\imaq
shared\imaqlib
imaq\imaqdemos
imaqblks\imaqblks
imaqblks\imaqmasks
imaqblks\imaqmex
instrument\instrument
instrument\instrumentdemos
instrumentblks\instrumentblks
instrumentblks\instrumentmex
instrumentblks\instrumentmasks
javabuilder\javabuilder
map\map
map\mapdemos
map\mapdisp
map\mapformats
map\mapproj
shared\maputils
slvnv\simcoverage
mpc\mpc
mpc\mpcdemos
mpc\mpcguis
mpc\mpcobsolete
MPC Toolbox
mpc\mpcutils
common\configuration
mpc555dk\mpc555demos
mpc555dk\mpc555dk
blockset\mfiles
rt\blockset
toolbox\nnet
nnet\nncontrol
.
nnet\nndemos
nndemos\nndatasets
nnet\nnadapt
nnet\nndatafun
nnet\nnderivative
nnet\nndistance
nnet\nndivision
nnet\nninitlayer
ctions.
nnet\nninitnetwork
unctions.
nnet\nninitweight
nctions.
nnet\nnlearn
nnet\nnnetfun
nnet\nnnetinput
nnet\nnnetwork
ns.
nnet\nnperformance
nnet\nnplot
nnet\nnprocess
nnet\nnsearch
nnet\nntopology
nnet\nntrain
nnet\nntransfer
nnet\nnweight
nnet\nnguis
Neural
Neural
Neural
Neural
Neural
Neural
Neural
Neural
Network
Network
Network
Network
Network
Network
Network
Network
Neural
Neural
Neural
Neural
Network
Network
Network
Network
Toolbox
Toolbox
Toolbox
Toolbox
Learning Functions.
Network Functions.
Net Input Functions.
Network Creation Functio
Neural
Neural
Neural
Neural
Neural
Neural
Neural
Neural
Neural
Network
Network
Network
Network
Network
Network
Network
Network
Network
Toolbox
Toolbox
Toolbox
Toolbox
Toolbox
Toolbox
Toolbox
Toolbox
Toolbox
Performance Functions.
Plot Functions.
Processing Functions.
Line Search Functions.
Topology Functions.
Training Functions.
Transfer Functions.
Weight Functions.
GUI Functions.
nnet\nnobsolete
nnet\nnutils
optim\optim
optim\optimdemos
toolbox\pde
pde\pdedemos
phased\phased
phased\phaseddemos
data_manager\data_manager
drive\drive
drive\drivedemos
elec\elec
elec\elecdemos
foundation\foundation
mech\mech
mech\importer
mech\mechdemos
network_engine\network_engine
ne_sli\ne_sli
pm_sli\pm_sli
powersys\powersys
DR\DRdemo
drives\drivesdemo
powersys\powerdemo
sdl\sdl
sdl\classic
sh\sh
sh\shdemos
simscape\simscapedemos
foundation\simscape
library\m
simscape\m
unit_manager\unit_manager
plccoder\plccoder
plccoder\plccoderdemos
qualkits\common
qualkits\do
qualkits\iec
slvnv\reqmgt
slvnv\slvnv
slvnv\rmidemos
rf\rf
rf\rfdemos
rf\rftool
rfblks\rfblks
rfblks\rfblksmasks
rfblks\rfblksdemos
robust\robust
robust\rctlmi
robust\rctutil
robust\rctdemos
rctobsolete\lmi
mutools\commands
mutools\subs
rptgen\rptgen
rptgen\rptgenv1
rptgen\rptgendemos
rptgenext\rptgenext
rptgenext\rptgenextv1
rptgenext\rptgenextdemos
shared\rptgen
- (No table of contents file)
rtw\rtwdemos
- Simulink Coder Demos
rtwdemos\rsimdemos
- (No table of contents file)
shared\sigbldr
- (No table of contents file)
shared\slcontrollib
- Simulink Control Design Library
signal\signal
- Signal Processing Toolbox
signal\sigtools
- (No table of contents file)
signal\sptoolgui
- (No table of contents file)
signal\sigdemos
- (No table of contents file)
simbio\simbio
- SimBiology
simbio\simbiodemos
- SimBiology Demos
shared\statslib
- Statistics Toolbox Library
simrf\simrf
- SimRF
simrf\simrfdemos
- SimRF 3.0.2 Demos
sl3d\sl3d
- Simulink 3D Animation
sl3d\sl3ddemos
- Simulink 3D Animation examples.
slcontrol\slcontrol
- Simulink Control Design
slcontrol\slctrlguis
- (No table of contents file)
slcontrol\slctrlutil
- (No table of contents file)
slcontrol\slctrldemos
- (No table of contents file)
sldo\sldo
- Simulink Design Optimization
sldo\sldodemos
- Simulink Design Optimization Demos.
sldodemos\optim
- (No table of contents file)
sldodemos\estim
- (No table of contents file)
sloptim\sloptim
- (No table of contents file)
sloptim\sloptguis
- (No table of contents file)
sloptim\sloptobsolete
- (No table of contents file)
slestim\slestguis
- (No table of contents file)
slestim\slestim
- (No table of contents file)
slestim\slestmex
- Simulink Design Optimization Estimation S-Funct
ion MEX-files.
slestim\slestutil
- (No table of contents file)
sldv\sldv
- Simulink Design Verifier
sldv\sldvdemos
- (No table of contents file)
shared\sldv
- sldvisactive
- Check if Simulink Design
Verifier software is analyzing model
slvnv\simcovdemos
- (No table of contents file)
slvnv\slvnvdemos
- (No table of contents file)
shared\slvnv
- (No table of contents file)
rptgenext\slxmlcomp
- (No table of contents file)
stats\stats
- Statistics Toolbox
stats\statsdemos
- Statistics Toolbox --- Demos
stats\classreg
- (No table of contents file)
symbolic\symbolic
- Symbolic Math Toolbox
symbolic\symbolicdemos
- (No table of contents file)
systemtest\systemtest
- SystemTest
systemtest\systemtestdemos
- SystemTest demonstrations and examples.
target\targetdemos
- (No table of contents file)
foundation\utils
- (No table of contents file)
blks\mex
- (No table of contents file)
blks\masks
- (No table of contents file)
processor\tic2000
- (No table of contents file)
tic2000\utils
- (No table of contents file)
blks\masks
- (No table of contents file)
tic2000\tic2000demos
- (No table of contents file)
processor\tic6000
- (No table of contents file)
tic6000\tfl
- (No table of contents file)
tic6000\utils
- (No table of contents file)
blks\masks
- TI C6000 (tm) Blocks
tic6000\tic6000demos
- (No table of contents file)
blks\masks
blks\mex
blks\masks
blks\masks
intelhost\tfl
ti\mdlinfo
ti\utils
blks\masks
etargets\etargets
etargets\demoutils
tasking\tasking
d in a future release.
tasking\taskingdemos
testmeaslib\simulink
blks\masks
tic5000\tic5000demos
ticcs\ccsblks
ticcs\ccsdemos
ccsdemos\util
ticcs\ccslinkblks
ccslinkblks\rtdxsimblks
ticcs\lic
ticcs\mdlinfo
ticcs\tfl
ticcs\util
ticcs\envChecker
vision\vision
vision\visionutilities
visionutilities\visioninit
visionutilities\visionmex
wavelet\wavelet
wavelet\wmultisig1d
wavelet\wavedemo
wavelet\compression
extensions\wrworkbench
wrworkbench\mdlinfo
xpc\xpc
xpcblocks\thirdpartydrivers
build\xpcblocks
xpc\xpcdemos
kernel\embedded
>>
>>
>>
>>
%STRUCTURI
BD.nume = 'Nele_Timea';
BD.an = 1985;
BD.localitate = 'Sighet'
BD =
nume: 'Nele_Timea'
an: 1985
localitate: 'Sighet'
>> BD
BD =
nume: 'Nele_Timea'
an: 1985
localitate: 'Sighet'
file)
file)
file)
file)
file)
file)
file)
file)
file)
file)
TASKING(R) will be remove
>> ST
??? Undefined function or variable 'ST'.
>> sf
BD
BD =
nume: 'Nele_Timea'
an: 1985
localitate: 'Sighet'
>> BD
BD =
nume: 'Nele_Timea'
an: 1985
localitate: 'Sighet'
>>
>>
>>
>>
BD(2).nume= 'RusMaria';
BD(2).an = 1988;
BD(2).localitate = 'Baia Mare';
BD(2)
ans =
nume: 'RusMaria'
an: 1988
localitate: 'Baia Mare'
>> BD(3)=struct('nume','Achim','an',1989,'localitate','Viseu');
>> BD
BD =
1x3 struct array with fields:
nume
an
localitate
>> BD.localitate
ans =
Sighet
ans =
Baia Mare
ans =
Viseu
>> char(BD.nume) %afiseaza pe coloana
ans =
Nele_Timea
RusMaria
Achim
>>
-----------------------------------------------------%-- 10/22/2015 6:10 PM --%
A=[2 7 6 ; 9 0 5; 3 0.9 6];
B=[8 7 0; 3 2 5; 4 -1 7]
A==B
u=[1 0 2 3 0 5];
v=[5 6 1 0 0 7];
u&v
u|v
u~v
~u
W=[5 NaN 8 Inf]
isnan(W)
a=1
b=1
xor(a,b)
xor(a,b);
q=[0 1 2 0]
all(q)
C=[0 1 2; 3 5 0]
all(C)
t=1:10:100
i=2;
j=input('j=');
[10 13 15]
if ,i+j>10
if i+j>10
f print f('i+j=10.3f\n', i+j);
end
fprintf('i+j=10.3f\n', i+j);
end
fprint f ('i+j=10.3f\n',i+j);
f print f('i+j=%10.3f\n',i+j);
fprint f('i+j=%10.3f\n',i+j);
fprint f('i+j=10.3f\n',i+j);
clc
i=2;
j=input('j=')
[10 13 15]
fprint f('i+j=%10.3f/n',i+j)
fprint f('i+j=%10.3f\n'i+j);
end
clc
%-- 10/29/2015 4:37 PM --%
X =input ('x=');
1
if x>0
fprintf('x este numar pozitiv\n')
else
fprintf ('x este numar negativ sau zero\n')
end
x = 1
end
culoare = input ('Tastati o culare:','s');
roz
switch culoare
case 'rosu'
disp ('Culoarea este rosu')
case 'galben'
disp ('Culoarea este galbena')
case 'albastru'
disp ('Culoarea este albastru')
otherwise
disp ('Este alta culoare')
end
x=1:2:11;
suma = 0;
suma = 0; %initializam variabila "suma"
for i=1 : length(x)
suma = suma+x(i)
end
x(1)=1
for n=2:6
x(n)=2*x(n-1);
end
x=1
%-- 10/29/2015 5:25 PM --%
for n=2:6
x(n)=2*x(n-1);
end
x=1:2:11;
for n=2:6
x(n)=2*x(n-1);
end
m = 5;
n =8;
for i=1:m %se repeta de m ori
for j = 1:n %se repeta de n ori
B(i,j)=1/(i+j-1);
end
B
B(i,j)=1/(i+j-1)
end
%-- 10/29/2015 5:32 PM --%
m = 5;
n =8;
for i=1:m %se repeta de m ori
for j = 1:n %se repeta de n ori
B(i,j)=1/(i+j-1);
end
end
b
B
%-- 11/2/2015 8:25 AM --%
%-- 11/5/2015 5:03 PM --%
a = 1:3:15
b = 1:15
c = 'Universitatea Baia Mare'
e = double(c)
g = char(e)
e = double(c) %afiseaza codul ASCII al literelor
j = ['Forta', 'de', 'reactiune']
Tablouri tridimensionale
>> %Tablouri 3D ---- 03.12.2015 --->> %folosim matrici "ones" ex. onse(4,4), "zeros", "rand" afiseaza valori intre
[0;1] si "randn" ex.randn (4,4)
>> randn(4,4)
ans =
0.5377
1.8339
-2.2588
0.8622
0.3188
-1.3077
-0.4336
0.3426
3.5784
2.7694
-1.3499
3.0349
0.7254
-0.0631
0.7147
-0.2050
>> U=ones(3,4,5)
U(:,:,1) =
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
U(:,:,2) =
1
1
1
U(:,:,3) =
1
1
1
U(:,:,4) =
1
1
1
U(:,:,5) =
1
1
1
>> U=ones(2,2,2)
U(:,:,1) =
1
1
1
1
U(:,:,2) =
1
1
1
1
>> U=zeros(2,2,2)
U(:,:,1) =
0
0
U(:,:,2) =
0
0
0
0
0
0
>>
>> U=ones(3,4,5)
U(:,:,1) =
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
U(:,:,2) =
1
1
1
U(:,:,3) =
1
1
1
U(:,:,4) =
1
1
1
U(:,:,5) =
1
1
1
>>
-------------Permutari------------->> p = perms(1:4); %permutari 1*2*3*4=24
>> A = magic(4);
>> M = ones(4,4,24); % 24 matrici de 4linii 4 coloane
>> for k =1:24
M(:,:,k) = A(:,p(k,:));
end
>> M
M(:,:,1) =
13
8
12
1
3
10
6
15
2
11
7
14
16
5
9
4
M(:,:,2) =
13
8
12
1
3
10
6
15
16
5
9
4
2
11
7
14
3
10
6
15
16
5
9
4
16
5
9
4
3
10
6
15
2
11
7
14
3
10
6
15
3
10
6
15
2
11
7
14
2
11
7
14
16
5
9
4
16
5
9
4
2
11
7
14
13
16
M(:,:,3) =
13
8
12
1
2
11
7
14
M(:,:,4) =
13
8
12
1
2
11
7
14
M(:,:,5) =
13
8
12
1
16
5
9
4
M(:,:,6) =
13
8
12
1
16
5
9
4
M(:,:,7) =
3
10
6
15
13
8
12
1
M(:,:,8) =
3
10
6
15
13
8
12
1
M(:,:,9) =
3
10
6
15
11
7
14
8
12
1
5
9
4
16
5
9
4
13
8
12
1
2
11
7
14
13
8
12
1
13
8
12
1
2
11
7
14
13
8
12
1
16
5
9
4
16
5
9
4
13
8
12
1
3
10
6
15
16
5
9
4
16
5
9
4
3
10
6
15
M(:,:,10) =
3
10
6
15
2
11
7
14
M(:,:,11) =
3
10
6
15
16
5
9
4
M(:,:,12) =
3
10
6
15
16
5
9
4
M(:,:,13) =
2
11
7
14
3
10
6
15
M(:,:,14) =
2
11
7
14
3
10
6
15
M(:,:,15) =
2
11
7
14
13
8
12
1
M(:,:,16) =
2
11
7
14
13
8
12
1
M(:,:,17) =
2
11
7
14
16
5
9
4
13
8
12
1
3
10
6
15
3
10
6
15
13
8
12
1
2
11
7
14
13
8
12
1
13
8
12
1
2
11
7
14
3
10
6
15
13
8
12
1
13
8
12
1
3
10
6
15
2
11
7
14
3
10
6
15
M(:,:,18) =
2
11
7
14
16
5
9
4
M(:,:,19) =
16
5
9
4
3
10
6
15
M(:,:,20) =
16
5
9
4
3
10
6
15
M(:,:,21) =
16
5
9
4
2
11
7
14
M(:,:,22) =
16
5
9
4
2
11
7
14
M(:,:,23) =
16
5
9
4
13
8
12
1
M(:,:,24) =
16
13
5
9
4
8
12
1
10
6
15
11
7
14
%apeleaza matricea 21------------------
ans =
16
5
9
4
2
11
7
14
3
10
6
15
24
13
8
12
1
size (M)
ans =
4
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
ans(:,:,2) =
34
34
ans(:,:,3) =
34
34
ans(:,:,4) =
34
34
ans(:,:,5) =
34
34
ans(:,:,6) =
34
34
ans(:,:,7) =
34
34
ans(:,:,8) =
34
34
ans(:,:,9) =
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
ans(:,:,10) =
34
34
ans(:,:,11) =
34
34
ans(:,:,12) =
34
34
ans(:,:,13) =
34
34
ans(:,:,14) =
34
34
ans(:,:,15) =
34
34
ans(:,:,16) =
34
34
ans(:,:,17) =
34
34
ans(:,:,18) =
34
34
ans(:,:,19) =
34
34
ans(:,:,20) =
34
34
ans(:,:,21) =
34
34
34
34
34
34
34
34
34
34
ans(:,:,22) =
34
34
ans(:,:,23) =
34
34
ans(:,:,24) =
34
34
34
ans(:,:,6) =
34
34
34
34
ans(:,:,7) =
34
34
34
34
ans(:,:,8) =
34
34
34
34
ans(:,:,9) =
34
34
34
34
ans(:,:,10) =
34
34
34
34
ans(:,:,11) =
34
34
34
34
ans(:,:,12) =
34
34
34
34
ans(:,:,13) =
34
34
34
34
ans(:,:,14) =
34
34
34
34
ans(:,:,15) =
34
34
34
34
ans(:,:,16) =
34
34
34
34
ans(:,:,17) =
34
34
34
34
ans(:,:,18) =
34
34
34
34
ans(:,:,19) =
34
34
34
34
ans(:,:,20) =
34
34
34
34
ans(:,:,21) =
34
34
34
34
ans(:,:,22) =
34
34
34
34
ans(:,:,23) =
34
34
34
34
ans(:,:,24) =
34
34
34
34
>> sum (M,3) %4x4
ans =
204
204
204
204
204
204
204
204
204
204
204
204
204
204
204
204
2
5
7
4
1
4
7
0
8
3
4
9
>> A(3,3)=A(1,3)+A(3,1)
A =
2
5
7
4
1
4
7
0
14
3
4
9
>> A(1,3)=A(1,3)+A(3,1)
A =
2
5
7
4
1
4
14
0
14
3
4
9
>> a = [2 6 4 8 3 7 1 0 6]
a =
2
>> b = a(3:7)
b =
4
>> c = a(2:2:8)
c =
6
>> c = a(2:3:8)
c =
6
>> c = a(2:4:8)
c =
6
>> c = a(2:5:8)
c =
6
>> B = A(1:3,2:4)
B =
4
1
4
14
0
14
3
4
9
>> B = A(1:2,2:4)
B =
4
1
14
0
3
4
>> C = A(:,3)
C =
14
0
14
>> D = A (1,2,:)
D =
4
>> E = [4 7 2 6; 7 3 5 6; 9 4 7 3]
E =
4
7
9
7
3
4
2
5
7
6
6
3
4
1
4
7
3
4
2
4
d =
4
7
9
4
1
4
7
2
5
7
3
4
2
5
7
>> d = F(:)
d =
1
3
2
4
>> %generare vector prin prin imbinarea elementelor a doi vectori
>> e = [1 3 5 7]
e =
1
>> f = [2 4 6 8]
f =
2
>> G = A(:,size(A,2):-1:1)
G =
2
5
7
7
3
4
4
1
4
4
7
9
>>
>> %inversarea linilor unei matrici
>> H = A(size(A,1):-1:1,:)
H =
9
7
4
4
1
4
4
3
7
7
5
2
>>
4
7
9
4
1
4
7
3
4
2
5
7
********************************************************************************
*************************