Ejercicio 7 Programacion.docx

  • Uploaded by: Jose Santamaria
  • 0
  • 0
  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Ejercicio 7 Programacion.docx as PDF for free.

More details

  • Words: 738
  • Pages: 9
EJERCICIO 7 >> rand('state',sum(100*clock)),R=reshape(randperm(36),6,6)

R=

13

27

18

6

33

31

32

9

29

25

24

11

5

26

19

35

8

1

7

28

4

34

36

2

14

12

22

30

21

15

20

17

10

23

3

16

>> R(5,3)

ans =

22

>> R(2:end,:)

ans =

32

9

29

25

24

11

5

26

19

35

8

1

7

28

4

34

36

2

14

12

22

30

21

15

20

17

10

23

3

16

>> R(:,1:end)

ans =

13

27

18

6

33

31

32

9

29

25

24

11

5

26

19

35

8

1

7

28

4

34

36

2

14

12

22

30

21

15

20

17

10

23

3

16

>> R(2:end-1,2:end-1)

ans =

9

29

25

24

26

19

35

8

28

4

34

36

12

22

30

21

>> R(1:2:5,:)

ans =

13

27

18

6

33

31

5

26

19

35

8

1

14

12

22

30

21

15

30

21

15

>> R(5:-2:3,:)

ans =

14

12

22

5

26

19

>> R(3:4,1:2)

ans =

5

26

7

28

>> R(:)

ans =

13 32 5 7 14 20 27 9 26 28 12 17 18 29 19 4 22

35

8

1

10 6 25 35 34 30 23 33 24 8 36 21 3 31 11 1 2 15 16

>> R(3:end-1,2:end-2)

ans =

26

19

35

28

4

34

12

22

30

>> R(:,[1:length(R)/2,end:-1:length(R)/2])

ans =

13

27

18

31

33

6

18

32

9

29

11

24

25

29

5

26

19

1

8

35

19

7

28

4

2

36

34

4

14

12

22

15

21

30

22

20

17

10

16

3

23

10

>> R([3,6,1,1,4],:)

ans =

5

26

19

35

8

1

20

17

10

23

3

16

13

27

18

6

33

31

13

27

18

6

33

31

7

28

4

34

36

2

33

31

>> R([3,6,2],[1,4,5])

ans =

5

35

8

20

23

3

32

25

24

>> [R,R;R,R]

ans =

13

27

18

6

13

27

18

6

33

31

32

9

29

25

24

11

32

9

29

25

24

11

5

26

19

35

8

1

5

26

19

35

8

1

7

28

4

34

36

2

7

28

4

34

36

2

14

12

22

30

21

15

14

12

22

30

21

20

17

10

23

3

16

20

17

10

23

3

16

13

27

18

6

33

31

13

27

18

6

33

31

32

9

29

25

24

11

32

9

29

25

24

11

5

26

19

35

8

1

5

26

19

35

8

1

7

28

4

34

36

2

7

28

4

34

36

2

14

12

22

30

21

15

14

12

22

30

21

20

17

10

23

3

16

20

17

10

23

3

15

15 16

>> sum(R)

ans =

91 119 102 153 125

76

>> prod(R)

ans =

4076800

36088416

8727840 123165000

14370048

>> median(R)

ans =

13.5000 21.5000 18.5000 27.5000 22.5000 13.0000

163680

>> sort(R)

ans =

5

9

4

6

3

1

7

12

10

23

8

2

13

17

18

25

21

11

14

26

19

30

24

15

20

27

22

34

33

16

32

28

29

35

36

31

>> sort(R,'ascend')

ans =

5

9

4

6

3

1

7

12

10

23

8

2

13

17

18

25

21

11

14

26

19

30

24

15

20

27

22

34

33

16

32

28

29

35

36

31

>> sort(R,'descend')

ans =

32

28

29

35

36

31

20

27

22

34

33

16

14

26

19

30

24

15

13

17

18

25

21

11

7

12

10

5

9

4

23 6

8 3

2 1

>> R(end,:)=[]

R=

13

27

18

6

33

31

32

9

29

25

24

11

5

26

19

35

8

1

7

28

4

34

36

2

14

12

22

30

21

>> R(:,end)=[]

R=

13

27

18

6

33

32

9

29

25

24

5

26

19

35

8

7

28

4

34

36

14

12

22

30

21

>> R(1:2,:)=[]

R=

5

26

19

35

8

7

28

4

34

36

14

12

22

>> R([4,2],:)=[]

30

21

15

Matrix index is out of range for deletion. >> R(:,[4,2])=[]

R=

5

19

8

7

4

36

14

22

21

>> R(:,:)=[]

R=

0×3 empty double matrix

Related Documents

Ejercicio 7
October 2019 14
Ejercicio 7
October 2019 20
Ejercicio 7 Pdd.xlsx
November 2019 15
Ejercicio 7.docx
December 2019 16

More Documents from "Rosmery"