Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How do u pass the data calculated from the previous function to another function
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
How do u pass the data calculated from the previous function to another function
0 comentarios
Respuestas (1)
Fangjun Jiang
el 11 de Nov. de 2011
abs() is a function, so is sin().
a=-3;
b=abs(a);
c=sin(b);
or
sin(abs(-3))
Does this answer your question?
5 comentarios
Fangjun Jiang
el 11 de Nov. de 2011
Maybe you should note that you need to make your function have an output argument.
function out=plus_one(in)
out=in+1;
function out=time_two(in)
out=2*in;
time_two(plus_one(1)) would yield 4.
Jan
el 11 de Nov. de 2011
@komal: You can read the code of e.g. MEAN: "edit mean.m". This is a function of a Matlab toolbox, but it is exactly the same mechanism as for user-defined functions. There are a lot of further good examples in the documentation and in the toolboxes.
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!