function lab10_pelda1_matlab2015
% adatok betoltese szoveges fajlbol (fixpontos szamok), szep 3D plot
    
    %{
    % adatfajl generalasa: 
    [X2, Y2] = meshgrid(-6:0.25:1, 0.5:0.1:2.5);
    Z2 = peaks(X2, Y2);
    figure;
    mesh(X2, Y2, Z2);
    
    filename='lab10_pelda1_adat.text';
    fs = filesep;
    dir_path = ['.', fs];
    file_path=[dir_path, filename];
    fid=fopen(file_path,'w');
    %z 21x29
    fprintf(fid, '%6.3f %6.3f %6.3f %6.3f %6.3f %6.3f\n', -6, 0.25, 1, 0.5, 0.1, 2.5);
    fprintf(fid, '%6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f\n', Z2);
    fclose(fid);
    %}

    filename='lab10_pelda1_adat.text';
    fs = filesep;
    dir_path = ['.', fs];
    file_path=[dir_path, filename];
    fid = fopen(file_path);
    d = fscanf(fid, '%f', [1 6]);
    Z = fscanf(fid, '%f', [21 inf]);
    fclose(fid);
    
    [X, Y] = meshgrid(d(1):d(2):d(3), d(4):d(5):d(6));
    
    figure;
    hold on;
    grid on;
    plot3(X, Y, Z, 'g.');
    [C, h] = contour3(X, Y, Z);
    view(-41, 28);
    clabel(C, h);
    colorbar;
    title('a betoltott adatpont-felho', 'FontSize', 14);
    xlabel('x', 'FontSize', 12, 'FontWeight', 'bold');
    ylabel('y', 'FontSize', 12, 'FontWeight', 'bold');
    zlabel('z', 'FontSize', 12, 'FontWeight', 'bold');
    
    
    
end
