% matlabintro1.m
% 2022.04.25. 

% egyszeru muveletek
X
2+3;
y = 2+3;
y
1:100
% x=1:10000
% x=1:10000;
clc
help
why
clc
% Vektorok
v = [2 3 4]
transpose(v)
help transpose
v'
% Vektor megadasa hibasan
% w = [4 5
% 6]
w = [4 5
6 7]
% matrixok
w = [4 5;6 7]
transpose(w)
w2 = [3 4;-2 5]
W = [w w2]
W = [w; w2]
W(3,2)
inv(w)
inv(W)
w
w*inv(w)
format long
w*inv(w)
eps
a = [3 2 4]
b = [2 5 8]
a+b
3*a-2*b
a*b
a*transpose(b)

%% Elemenkenti muvelet vegrehajtas
a
b
a.*b
a.^2
a*a
a^2
a.^2
G = [-1 2;2 3]
G^2
G.^2
exp(G)
eig(G)
[m,la] = eig(G)
m1 = m(:,1)
m2 = m(:,2)
%% Abrazolas
clc
figure
gcf
t = -3:0.1:5;
x = 2*t+3;
y = 2*t*t;
y = 2*t.*t;
plot(t,x,'r-o')
figure; plot(t,y,'b--x')
t2 = [-3:1:5 -4:0.4:7]
y2 = 2*t2.^2;
figure; plot(t2,y2,'k-d');
t2 = sort(t2)
y2 = 2*t2.^2;
figure; plot(t2,y2,'k-d');
doc print
close all
p = [3 -2 0.5];
t = linspace(0.1,10,100);
whos
who
%% poliunomok reprezentacioja, hasznalata
y = polyval(p,t);
figure; plot(t,y,'r-o','LineWidth',2);
set(gca,'MarkerFaceColor','g')
figure; plot(t,y,'r-o','LineWidth',2,'MarkerFaceColor','g','MarkerSize',12);
close all
figure; hl = plot(t,y,'r-o','LineWidth',2,'MarkerFaceColor','g','MarkerSize',12);
hl.MarkerEdgeColor = 'b'