Result of a function
25 次查看(过去 30 天)
显示 更早的评论
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 个评论
dpb
2020-5-24
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!