New variable creation in matlab

Hi,
Can we create new variables inside a function apart from the input variables taken during the calling of function. If so how???
My exoerience:
It is showing an error saying that "Unrecognized function or variable 'days_in_month'."

답변 (1개)

Star Strider
Star Strider 2020년 3월 19일

0 개 추천

It is certainly possible to create variables inside a function. As with other variables, each needs to be assigned a value before they can be used in other expressions.
So:
days_in_month = 31;
will work.

이 질문은 마감되었습니다.

태그

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by