How to create a void function in MATLAB?

597 次查看(过去 30 天)
I want to create a function that does not return a value, but instead plots something on a given interval.
I learned programming with C, and in C the following syntax was used: void fname(input_type inp).
What's the analogue for this in MATLAB?

采纳的回答

Friedrich
Friedrich 2013-7-9
编辑:Friedrich 2013-7-9
Hi,
%void myfun(void)
function myfun()
%void myfun(double a)
function myfun(a)
So in your case something like that I guess:
function myfun(a,b)
plot(a:b)
And call it with
myfun(1,7)
  2 个评论
Cedric
Cedric 2013-7-13
编辑:Cedric 2013-7-13
Don't forget to [ Accept the Answer ] if it solved your problem.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by