How can i set input command for undefined variable?

조회 수: 3 (최근 30일)
Triveni
Triveni 2016년 8월 8일
답변: Walter Roberson 2016년 8월 8일
I have a input.
x_ang = [0 0 15 15 30, fliplr([0 0 15 15 30])];% [X,NN] = RunLength(x_ang);
it = 10; x=4;y=10;
if a comment on x_ang,
%x_ang = [0 0 15 15 30, fliplr([0 0 15 15 30])];% [X,NN] = RunLength(x_ang);
and if "x_ang" is not available, then i want to input automatically x_ang, then how can i make condition for this?

채택된 답변

Walter Roberson
Walter Roberson 2016년 8월 8일
if ~exist('x_ang', 'var')
x_ang = input('Enter x_ang values');
end

추가 답변 (0개)

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by