Hi community, Ihave a slight problem. I have written a program which include plotting of graph. Now i want the program to prompt me to input desired axes titles when the program is executed/run. Can somebody asist.

 채택된 답변

Askic V
Askic V 2023년 1월 23일
편집: Askic V 2023년 1월 23일

1 개 추천

I would do ike this:
x = linspace(0, 50);
y = sin(x);
plot(x,y);
input_x = input('Enter name for x label:','s');
input_y = input('Enter name for y label:','s');
xlabel(input_x)
ylabel(input_y)

추가 답변 (1개)

KSSV
KSSV 2023년 1월 23일

0 개 추천

plot(rand(1,10))
labelx = input('Input Xlabel:') ;
labely = input('Input Ylabel:') ;
xlabel(labelx)
ylabel(labely)

카테고리

도움말 센터File Exchange에서 Line Plots에 대해 자세히 알아보기

제품

태그

질문:

2023년 1월 23일

편집:

2023년 1월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by