# I have a question about time. Suppose the start time of a movie is 12:35 and the duration of the movie is 125 minutes. Is there any function in MATLAB that shows the finish time of the movie? Thanks

1 visualización (últimos 30 días)
yashar khatib shahidi el 1 de Mayo de 2015
Comentada: Star Strider el 2 de Mayo de 2015
I have a question about time. Suppose the start time of a movie is 12:35 and the duration of the movie is 125 minutes. Is there any function in MATLAB that shows the finish time of the movie? Thanks
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Respuesta aceptada

Star Strider el 1 de Mayo de 2015
If you have R2014b or later, use the duration function:
H = 12;
MI = 35+[0:125];
S = 0;
D = duration(H,MI,S);
MovieStart = D(1)
MovieFinish = D(end)
produces:
MovieStart =
12:35:00
MovieFinish =
14:40:00
##### 8 comentariosMostrar 6 comentarios más antiguosOcultar 6 comentarios más antiguos
yashar khatib shahidi el 2 de Mayo de 2015
Sorry I tried the code but it gives error. What is B = A*A' for? Thanks
Star Strider el 2 de Mayo de 2015
It’s been a while since i used persistent variables.
This works:
function [B,y] = myfun(A)
persistent x
x = size(A)
B = A*A';
y = x;
end
The call to it is the same.
The
B = A*A';
is just to give it something to do.

Iniciar sesión para comentar.

### Categorías

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

### Community Treasure Hunt

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

Start Hunting!

Translated by