How can I write a matlab function to take one number and display double, triple, and quadruple of the number?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Can you make it also using M-file?
0 comentarios
Respuestas (1)
Image Analyst
el 24 de Feb. de 2022
Do you mean like
function fun(a)
fprintf('a = %f\n2*a = %f\n3*a = %f\n4*a = %f', a, 2*a, 3*a, 4*a);
Of course you can do it in an m-file. How else were you thinking of doing it?
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!