Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //baca matrix dari file .csv
- if (($handle = fopen('the_matrix.csv', 'r')) !== FALSE) {
- $m1=array();
- $row=0;
- while (($data = fgetcsv($handle)) !== FALSE) {
- for($col=0;$col<count($data);$col++){
- $m1[$row][$col]=$data[$col];
- }
- $row++;
- }
- fclose($handle);
- } else {
- echo 'Failed to read the file!';
- exit();
- }
- echo 'Original Matrix:';
- print_matrix($m1);
- $start_time = microtime(true);
- $pangkat=mat_pow($m1, 512);
- $stop_time = microtime(true);
- echo 'Matrix after power to 512:';
- print_matrix($pangkat);
- echo 'Time needed to calculate (ms) = '.($stop_time-$start_time);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement