<div dir="ltr"><div>Hi all,</div><div>As a Scilab user, I am currently fighting to reach Matlab performance..My current scilab program takes 4x more than my matlab's vesion. Here are some instructions requiring some optimizations.. If you have an idea... thanks a lot!</div><div><br></div><div>All times are cumulative times after the execution (iterations)<br>I used the Matlab and Scilab profilers<br>tooth_psi_angle is a 70000x4 2D matrix of real numbers<br>tool.forces.cutting_forces_teeth_TCS is a 72000x4x3 matrix of real numbers<br>process.fz is a scalar <br>tool.kappa is a scalar</div><div><br>if tool_angle(i) < tool.pitch_angle then<br>     h_total(i) = process.fz * sin(tooth_psi_angle(i,tooth)) * sin(tool.kappa);</div><div><br></div><div>=> Matlab:<0.01s  vs Scilab 4.8s</div><div><br>ROT_LCS_TCS =[-cos(tooth_psi_angle(i,tooth)) -sin(tool.kappa)*sin(tooth_psi_angle(i,tooth)) -cos(tool.kappa)*sin(tooth_psi_angle(i,tooth)); sin(tooth_psi_angle(i,tooth)) -sin(tool.kappa)*cos(tooth_psi_angle(i,tooth)) -cos(tool.kappa)*cos(tooth_psi_angle(i,tooth)); 0 cos(tool.kappa) -sin(tool.kappa)]; // result is a 3x3 matrix</div><div><br>=> Matlab:0.67s  vs Scilab 4s</div><div><br>tool.forces.cutting_forces_teeth_TCS(i,tooth,:) = ROT_LCS_TCS*[ft;fr;fa];</div><div><br>=> Matlab:0.55s  vs Scilab 1.3s</div><div><br>Regards<br>Michael</div><div></div></div>