15102024 (1)
15102024 (1)
Error in <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('h4_2024_1',
'E:\Belgelerim\MATLAB\h4_2024_1.m', 1)" style="font-weight:bold">h4_2024_1</a> (<a
href="matlab: opentoline('E:\Belgelerim\MATLAB\h4_2024_1.m',1,0)">line 1</a>)
matris = [1:3;4:6;7:8]
}#
h4_2024_1
matris =
1 2 3
4 5 6
7 8 9
matris(2,3)
ans =
h4_2024_1
"Toplam = " "45"
h4_2024_1
{#<a href="matlab: opentoline('E:\Belgelerim\MATLAB\h4_2024_1.m',6,16)">File:
h4_2024_1.m Line: 6 Column: 16</a>
Incorrect use of '=' operator. Assign a value to a variable using '=' and
compare values for equality using '=='.
}#
h4_2024_1
{#Undefined function 'toplam' for input arguments of type 'char'.
Error in <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('h4_2024_1',
'E:\Belgelerim\MATLAB\h4_2024_1.m', 6)" style="font-weight:bold">h4_2024_1</a> (<a
href="matlab: opentoline('E:\Belgelerim\MATLAB\h4_2024_1.m',6,0)">line 6</a>)
toplam += matris(i,j);
}#
a=3
a =
a+=7
a+=7
↑
{#Incorrect use of '=' operator. Assign a value to a variable using '=' and
compare values for equality using '=='.
}#
a=a+7
a =
10
h4_2024_2
i =
1
4
7
i =
2
5
8
i =
3
6
9
h4_2024_2
toplam =
6
15
24
matris
matris =
1 2 3
4 5 6
7 8 9
h4_2024_2
toplam =
45
h4_2024_2
toplam =
h4_2024_2
i =
1
i =
i =
toplam =
matris
matris =
1 2 3
h4_2024_2
toplam =
45
matris
matris =
1 2 3
4 5 6
7 8 9
h4_2024_3
"1. Köşegen Toplamı = " "15"
h4_2024_3
"1. Köşegen Toplamı = " "15"
h4_2024_3
"1. Köşegen Toplamı = " "17"
matris
matris =
1 2 3
4 5 6
9 10 11
h4_2024_4
Bir tamsayı giriniz :5
h4_2024_4
Bir tamsayı giriniz (n>0) :-5
Girdiğiniz sayı negatiftir.
h4_2024_4
Bir tamsayı giriniz (n>0) :3
Faktoriyel =
h4_2024_4
Bir tamsayı giriniz (n>0) :5
faktoriyel =
120
ans =
h4_2024_4
Bir tamsayı giriniz (n>0) :3
faktoriyel =
h4_2024_4
Bir tamsayı giriniz (n>0) :3
Faktoriyel =3
ans =
h4_2024_4
Bir tamsayı giriniz (n>0) :3
Faktoriyel = 6
h4_2024_4
Bir tamsayı giriniz (n>0) :3
Faktoriyel = 6
h4_2024_5
Bir sayı gir (0,1,-1):6
Lütfen istenen değerlerden birini girin!
h4_2024_5
Bir sayı gir (0,1,-1):0
Girilen sayı 0.
h4_2024_5
Bir sayı gir (0,1,-1,-2):-2
Sayı -1 veya -2
help switch
<strong>switch</strong> Switch among several cases based on expression.
The general form of the <strong>switch</strong> statement is:
<strong>switch</strong> switch_expr
CASE case_expr,
statement, ..., statement
CASE {case_expr1, case_expr2, case_expr3,...}
statement, ..., statement
...
OTHERWISE,
statement, ..., statement
END
The statements following the first CASE where the switch_expr matches
the case_expr are executed. When the case expression is a cell array
(as in the second case above), the case_expr matches if any of the
elements of the cell array match the switch expression. If none of
the case expressions match the switch expression then the OTHERWISE
case is executed (if it exists). Only one CASE is executed and
execution resumes with the statement after the END.
Only the statements between the matching CASE and the next CASE,
OTHERWISE, or END are executed. Unlike C, the <strong>switch</strong>
statement
does not fall through (so BREAKs are unnecessary).
Example:
method = 'Bilinear';
switch lower(method)
case {'linear','bilinear'}
disp('Method is linear')
case 'cubic'
disp('Method is cubic')
case 'nearest'
disp('Method is nearest')
otherwise
disp('Unknown method.')
end
Method is linear
h4_2024_5
Bir sayı gir (0,1,-1,-2):10
Girilen sayı 0.
weekday(date,'long','tr-TR')
ans =
help weekday
<strong>weekday</strong> Day of week.
DAYNUM = <strong>weekday</strong>(T) returns the day of the week number for
each element
of T. T is a numeric array containing serial date numbers. T can also
be a cell vector, character matrix, or string array containing date
strings in one of the following formats (see DATESTR for more details
about date formats):
* mm/dd/yyyy
* dd-mmm-yyyy
* yyyy-mm-dd
DAYFORM and LANGUAGE are optional and can be combined in any order
following T.
Examples:
[num,name] = weekday(728647)
[num,name] = weekday('19-Dec-1994')
[num,name] = weekday('19-Dec-1994','long','local')
[num,name] = weekday(datenum('12/19/1994','mm/dd/yyyy'))
[gg,nn]=weekday(728647)
gg =
2
nn =
'Mon'
h4_2024_6
Haftanın gününü sayı olarak girin:2
Salı
h4_2024_7
h4_2024_7
rand
ans =
0.8147
help rand
<strong>rand</strong> Uniformly distributed pseudorandom numbers.
R = <strong>rand</strong>(N) returns an N-by-N matrix containing pseudorandom
values drawn
from the standard uniform distribution on the open interval(0,1).
<strong>rand</strong>(M,N)
or <strong>rand</strong>([M,N]) returns an M-by-N matrix.
<strong>rand</strong>(M,N,P,...) or
<strong>rand</strong>([M,N,P,...]) returns an M-by-N-by-P-by-... array.
<strong>rand</strong> returns a
scalar. <strong>rand</strong>(SIZE(A)) returns an array the same size as A.
Examples:
Example 4: Save the settings for the random number generator used by
<strong>rand</strong>, RANDI, and RANDN, generate 5 values from
<strong>rand</strong>, restore the
settings, and repeat those values.
s = rng
u1 = rand(1,5)
rng(s);
u2 = rand(1,5) % contains exactly the same values as u1
randi
{#Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('randi')"
style="font-weight:bold">randi</a>
Not enough input arguments.
}#
help randi -displayBanner
--- help for <strong>randi</strong> ---
Examples:
Example 5: Save the settings for the random number generator used by
RAND, <strong>randi</strong>, and RANDN, generate 5 values from
<strong>randi</strong>, restore the
settings, and repeat those values.
s = rng
i1 = randi(10,1,5)
rng(s);
i2 = randi(10,1,5) % i2 contains exactly the same values as i1
Examples:
Example 3: Reset the random number generator used by RAND, RANDI, and
<strong>randn</strong> to its default startup settings, so that
<strong>randn</strong> produces the same
random numbers as if you restarted MATLAB.
rng('default');
randn(1,5)
Example 4: Save the settings for the random number generator used by
RAND, RANDI, and <strong>randn</strong>, generate 5 values from
<strong>randn</strong>, restore the
settings, and repeat those values.
s = rng
z1 = randn(1,5)
rng(s);
z2 = randn(1,5) % z2 contains exactly the same values as z1
r = 1 + 2.*randn(100,1);
r = 1 + 2.*randn(100,1)
r =
-0.7761
1.2002
-0.0891
1.6070
-0.2007
1.9799
2.4787
4.4238
0.6118
-3.2767
-0.6792
3.7092
-1.1443
2.9219
1.2481
3.8734
-2.9218
0.6046
-1.4157
6.8160
2.6504
3.7579
-1.1164
0.0628
0.4551
3.1968
0.4443
2.4031
-3.1036
0.2923
-0.6472
-2.1541
2.0159
1.5640
1.0670
-1.6674
3.2550
1.7004
0.4019
1.0458
0.4760
-2.5004
0.4287
-0.6627
-0.9584
-1.3128
-0.0671
-3.0053
2.9285
2.0401
0.9599
0.9305
-0.5963
3.0374
0.7336
-0.4291
3.7028
0.5505
-0.1781
0.4125
-0.6959
-1.2403
6.0520
4.3110
1.6151
-1.5142
-0.7309
0.6469
2.5828
-1.6640
-3.6597
-1.8982
1.6670
1.7827
1.9034
0.7394
1.3674
0.0477
2.7240
-1.7234
1.9101
-0.6974
0.3302
2.1056
3.0782
-1.2353
3.5213
2.3203
0.8643
0.6096
0.5648
0.3938
1.0461
1.1026
2.6521
4.0540
1.9338
0.5806
2.2504
1.3665
r = 1 + 2.*randn
r =
-1.0595
r = 1 + 2.*randn
r =
2.8984
r = 1 + 2.*randn
r =
1.6141
r = 1 + 2.*randn
r =
1.2703
r = 1 + 2.*randn
r =
2.0305
r = 1 + 2.*randn
r =
1.5228
r = 1 + 2.*randn
r =
-0.8830
r = 1 + 2.*randn
r =
0.6753
r = 1 + 2.*randn
r =
0.7079
r = 1 + 2.*randn
r =
-0.0640
r = 1 + 2.*randn
r =
4.3642
r = 1 + 2.*randn
r =
-0.7515
r = 0 + 1.*randn
r =
-0.4838
r = 0 + 1.*randn
r =
-0.7120
r = 0 + 1.*randn
r =
-1.1742
r = 0 + 1.*randn
r =
-0.1922
r = 0 + 1.*randn
r =
-0.2741
r = 0 + 1.*randn
r =
1.5301
r = 0 + 1.*randn
r =
-0.2490
r = 0 + 1.*randn
r =
-1.0642
r = 0 + 1.*randn
r =
1.6035
r = 0 + 1.*randn
r =
1.2347
r = 0 + 1.*randn
r =
-0.2296
r = 0 + 1.*randn
r =
-1.5062
r = 0 + 1.*randn
r =
-0.4446
rand
ans =
0.4087
rand *10
{#Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('rand')"
style="font-weight:bold">rand</a>
CLASSNAME argument must be a class that supports RAND, such as 'double' or
'single'.
ans =
5.9490
rand * 10
ans =
2.6221
ceil(rand*5)
ans =
fix
{#Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('fix')"
style="font-weight:bold">fix</a>
Not enough input arguments.
}#
matlab.internal.language.introspective.errorDocCallback('fix')
fix(rand)
ans =
fix(rand)
ans =
fix(rand)
ans =
fix(rand)
ans =
fix(rand*5)
ans =
fix(rand*5)
ans =
fix(rand*5)
ans =
fix(rand*5)
ans =
fix(rand*5)
ans =
fix(rand*5)
ans =
fix(rand*5)
ans =
fix(rand*5)
ans =
fix(rand*5)
ans =
fix(rand*5)
ans =
fix(rand*5)
ans =
fix(rand*5)
ans =
fix(rand*5)
ans =
fix(rand*5)
ans =
round(rand*5)
ans =
round(rand*5)
ans =
round(rand*5)
ans =
1
round(rand*5)
ans =
round(rand*5)
ans =
h4_2024_8
matris =
7 4 4
10 0 9
9 8 1
h4_2024_8
matris =
3 3 7
1 7 1
7 5 8
h4_2024_8
matris =
7 9 9
3 7 2
0 7 5
h4_2024_8
matris =
5 9 6
6 9 8
6 2 2
h4_2024_8
matris =
9 0 5
2 10 7
5 5 1
h4_2024_8
matris =
7 0 1
5 1 8
8 7 1
h4_2024_8
matris =
7 5 10
6 8 5
4 8 1
h4_2024_8
matris =
1 2 4
8 8 1
4 5 4
h4_2024_8
matris =
7 6 3
4 0 10
2 1 4
h4_2024_8
matris =
2 5 3
10 9 1
7 3 4
h4_2024_8
matris =
5 9 4
10 3 7
7 5 7
h4_2024_8
matris =
7 2 1
10 2 0
6 9 7
h4_2024_8
matris =
2 4 5
10 2 9
6 4 2
h4_2024_8
matris =
4 5 1
6 2 4
6 3 3
h4_2024_8
matris =
6 3 8
10 7 3
6 1 9
help fix
<strong>fix</strong> Round towards zero.
<strong>fix</strong>(X) rounds the elements of X to the nearest integers
towards zero.
floor(1.9)
ans =
ceil(1.1)
ans =
fix(1.9)
ans =
1
fix(1.1)
ans =
floor(-2.2)
ans =
-3
ceil(2.5)
ans =
ceil(-2.5)
ans =
-2
h4_2024_8
matris =
9 9 3
6 1 5
4 2 2
h4_2024_8
matris =
5 1 6
5 7 7
7 1 1
h4_2024_8
matris =
4 6 7
5 9 8
10 6 4
h4_2024_8
matris =
2 7 8
5 1 3
2 3 5
h4_2024_8
matris =
6 5 9
6 10 7
10 3 7
h4_2024_8
matris =
3 7 7
1 3 3
7 9 4
h4_2024_8
matris =
8 7 1
7 4 10
1 5 5
h4_2024_8
matris =
5 8 4
8 5 1
2 8 5
h4_2024_8
matris =
2 4 7
2 8 3
10 3 8
h4_2024_8
matris =
2 3 1
6 7 6
5 7 7
h4_2024_8
matris =
7 7 10
3 8 3
2 7 5
h4_2024_8
matris =
5 7 8
4 7 5
9 9 3
h4_2024_8
matris =
7 6 6
9 3 4
2 10 7
h4_2024_8
matris =
5 7 6
7 6 8
6 10 3
h4_2024_8
matris =
2 2 1
5 5 4
8 7 8
h4_2024_8
matris =
10 10 2
2 7 1
6 6 9
h4_2024_8
matris =
5 4 7
8 6 4
2 6 3
h4_2024_8
matris =
1 8 3
5 7 4
8 4 7
h4_2024_8
matris =
8 5 1
4 5 3
2 9 5
h4_2024_8
matris =
9 4 8
4 9 8
4 3 8
h4_2024_8
matris =
10 4 7
5 9 8
2 9 10
h4_2024_9
Sayı : (0,1,2)9
Değer dışı
h4_2024_9
Sayı : (0,1,2)1
1
diear off
{#Unrecognized function or variable 'diear'.
}#
diary off