Borrar filtros
Borrar filtros

Executing a fprintf statement with a function

2 visualizaciones (últimos 30 días)
Teoman Selcuk
Teoman Selcuk el 3 de Dic. de 2021
Respondida: Image Analyst el 3 de Dic. de 2021
How would I be able to pass and fprintf a tsring in the code below? The code below is faulty and not working
a= pass('hello');
function output = pass(var)
fprintf('%s', var);
end

Respuestas (1)

Image Analyst
Image Analyst el 3 de Dic. de 2021
Get rid of a=, or else assign a inside of the function. Right now you are trying to accept something into a in your calling routine, but the function does not pass anything back. So call it like this:
pass('hello');

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by