0% found this document useful (0 votes)
16 views

Matlab 1

The document contains instructions to perform tasks in Matlab and C# programming languages. It includes commands to: 1) Create matrices A and B, add them together, and store the result in matrix C. 2) Create a 3x3 matrix F with all elements as zero. 3) Add all elements from the first row of matrix A. 4) Create a vector X with elements from 1 to 1000.

Uploaded by

Nenad Femic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Matlab 1

The document contains instructions to perform tasks in Matlab and C# programming languages. It includes commands to: 1) Create matrices A and B, add them together, and store the result in matrix C. 2) Create a 3x3 matrix F with all elements as zero. 3) Add all elements from the first row of matrix A. 4) Create a vector X with elements from 1 to 1000.

Uploaded by

Nenad Femic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Zadatke raditi u programskom jeziku matlab, i programskom jeziku C#.

1. Napisati komande koje kreiraju matricu A i B, potom sabrati iste i rezultat


prikazati u novoj formiranoj matrici C
A =

17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9

B=

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

C = ?

2. Napisati komandu koja kreira matricu F reda 3x3 gde su svi elementi nula
3.Napisati komande koje sabiraju sve elemente iz prvog reda Matrice A ?
4.Napisati komandu koja kreira vektor X sa sledecim elementima
1, 5,10, 15, 20,... 1000
5. Napisati komandu koja kreira vektor Y sa sledecim elementima 1, 5,10, 15, 20,...
1000
6.Data su 2 vektora X=[-1 3 6 -3 4] i vektor Y=[1 3 2].
Objasniti sta je rezultat upotrebe komande x(y) i kako se matematicki dolazi do
njega.
7. Napisati komandu koja izrazunava duzinu vektora X ?
8. Ako je data matrica p

P =

8 1 6
3 5 7
4 9 2

Koristeci komandu E=P([1 3],[2 3]) objasniti sta je rezultat i kako se matematicki
dolazi do njega !

9.Data je matrica
X =

92 99 1 8 15 67 74 51 58 40
98 80 7 14 16 73 55 57 64 41
4 81 88 20 22 54 56 63 70 47
85 87 19 21 3 60 62 69 71 28
86 93 25 2 9 61 68 75 52 34
17 24 76 83 90 42 49 26 33 65
23 5 82 89 91 48 30 32 39 66
79 6 13 95 97 29 31 38 45 72
10 12 94 96 78 35 37 44 46 53
11 18 100 77 84 36 43 50 27 59

Kojom komandom mozemo izvuci elemente u novu submatricu


15
16
22
3

10. Za datu matricu


Q =

17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
napisati komandu koji uzima samo elemente poslednje kolone i formira novu matricu W
i isto tako uzima samo elemente iz
drugog reda matrice Q i dodeljuje novoj matrici W2.

You might also like