%slCharacterEncoding('UTF-8')
%slCharacterEncoding('US-ASCII') 
slCharacterEncoding('Windows-1252') 
%%%%%%%%%%%Zadanie 1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Wczytaj plik daneLab2.mat, w którym s¹ dane pacjentów po przeszczepie nerki
%odpowiednio kolejne kolumy to: 
% 1 "wiek biorcy"        % 2 "wiek dawcy"        % 3 "CIT"  
% 4 "wynik biopsji nr1"  % 5 "wynik biopsji nr2" % 6 "cukrzyca"      
% 7 "dawka leku"         % 8 "pomiar sprawnoœci nerki po 7 dniach"  
% 9 "sprawnosc nerki po 30 dniach" % 10 "sprawnosc nerki po 3 miesi¹cach"
% wykorzystaj: >> load daneLab2.txt -ascii    lub      load('daneLab2.txt')
%%%%%%%%%%%
% Zwróæ uwagê ¿e jest 11 kolumn, w rzeczywistoœci 1 kolumna to index
% pacjenta!
% Na podstawie danych z pliku oblicz/wyznacz:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% a) œredni wiek dawcy i minimalny wiek biorcy,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% b) ustal liczbe wszystkich wykonanych przeszczepów nerek 
%liczbaPrzeszczepow = size(data,1)
% wyswietl wynik biopsji nr1 dla 15 pacjenta
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% c) korzystaj¹c z funkcji sort() posortuj dane ze wzglêdu na wiek biorcy 
% (od najm³odszego do najstarszego)
% wykorzystaj >> help sort          >> [val,indexwiersza]=sort(wektor)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% d) okreœl ile procent dawców ma wiek poni¿ej 30lat 
% wykorzystaj funkcje: find()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% e) wyswietl dane wybranych pacjentów po przeszczepie nerki tj.
% wybierz biorcow w wieku powy¿ej 25lat, u których nie wyst¹pi³a cukrzyca
% (wartoœæ w kolumnie 1 - cukrzyca, 0 - brak cukrzycy)
% okresl ilu jest takich pacjentów 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% f) narysuj wykres na którym przedstawisz dla pacjenta nr 273 
% nastêpuj¹c¹ zale¿noœæ: 
% wartoœæ pomiarów okreœlaj¹cych sprawnoœæ nerki od liczby dni 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% g) narysuj wykres na którym przedstawisz nastêpuj¹c¹ zale¿noœæ dla 
% kazdego pacjenta: wartoœæ "sprawnosc nerki po 7 dniach" 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% h) w zbiorze danych zamieñ miejscami kolumny "wynik biopsji nr1" i
% "wynik biopsji nr2" a nastêpnie 
% usun kolumnê "CIT" uzyskany wynik zapisz do pliku daneLab1_nowe.mat
%wykorzystaj >> save  daneLab1_nowe.mat v-ascii 
%(gdzie v to zapisywana macierz z danymi)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
