Defining a Variable Ranging from One Value To Another

조회 수: 11 (최근 30일)
Alex Reyes
Alex Reyes 2020년 12월 13일
댓글: Alex Reyes 2020년 12월 13일
Hello! I'm new to MATLAB and need to define a variable, x, ranging from 0 to 2pi so I can evaluate a function at an arbitrary x-value in that range. Thank you!

채택된 답변

John D'Errico
John D'Errico 2020년 12월 13일
편집: John D'Errico 2020년 12월 13일
You really need to read the basic tutorials. You cannot define a variable that is restricted to live in a specific interval.
Are you really asking how to limit the set of values a variable will take when you write a function? Or are you asking how to create a vector of variables that ranges over some interval. This requires nothing more than linspace.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by