How to create a void function in MATLAB?

188 ビュー (過去 30 日間)
Omulus
Omulus 2013 年 7 月 9 日
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 件のコメント
Omulus
Omulus 2013 年 7 月 13 日
Thanks.
Cedric
Cedric 2013 年 7 月 13 日
編集済み: Cedric 2013 年 7 月 13 日
Don't forget to [ Accept the Answer ] if it solved your problem.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by