Having difficulty in understanding Matlab Code.

3 visualizaciones (últimos 30 días)
Bhuvan Khoshoo
Bhuvan Khoshoo el 6 de Oct. de 2019
Comentada: Walter Roberson el 6 de Oct. de 2019
I have to make a lookup table that relates the torue commands to corresponding current and torque angle values.
For Current increased from 0 to max value, I calclate the corresponding torque angle and torque values.
I am getting maximum torque = 3481.1 N-m.
Can you help me in understanding what exactly is happening in the code that is shown below?
Thanks.
  1 comentario
Walter Roberson
Walter Roberson el 6 de Oct. de 2019
The t_saved assignment through the for i loop can be replaced with
[~, point(j)] = min(abs(T_j - Torque));
That is, the point of the loops is to find the location of the value in Torque that is closest to each T_point value.
The whole logic could probably be replaced with a call to interp1(), something like
T_point = 0:1:3481.10;
point = interp1(Torque, 1:length(T_point), T_point, 'nearest');

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Entering Commands en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by