Result of a function

8 visualizaciones (últimos 30 días)
Omer Acil
Omer Acil el 24 de Mayo de 2020
Comentada: dpb el 24 de Mayo de 2020
Hello,
function encStr=encrypt(s,key)
encStr=char(s+key);
end
This is my base function I want to define a encStr to use it later but after using the function I have an error
>> encrypt('demi',3)
ans =
'ghpl'
>> encStr
Unrecognized function or variable 'encStr'.
Can you help me please? Thanks!
  3 comentarios
Omer Acil
Omer Acil el 24 de Mayo de 2020
Is there a way that I can store my answer and define it with a name?
dpb
dpb el 24 de Mayo de 2020
Yes. Just call your function like any other MATLAB function with a variable name on the LHS of an assignment.
As noted, read the basic information and examples on using functions.
You assigned a result inside your function, there's no difference at the calling level syntax-wise.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

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

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by