How do I plot data points with x-axis tick labels that are strings?
이전 댓글 표시
hello there, i have 15 (x) points named x1 to x15; and corresponding to this i have 15 (y) points named from y1 to y15. how can i plot them ?
댓글 수: 4
James Tursa
2017년 9월 18일
Don't create variable names like this in the first place. As you can tell, it becomes hard to work with them downstream in your code. Instead, rewrite your code to produce a single variable named x that has all of the 'x' values, and another variable called y for the 'y' values. Then it is simple:
plot(x,y);
MAHMOUD ALZIOUD
2017년 9월 18일
Marylyn Sammut
2022년 1월 14일
how can you do it with plot(data, ‘.’, (signalNoise,signalTime)
Walter Roberson
2022년 1월 15일
편집: Walter Roberson
2022년 1월 24일
I have the suspicion that you might be attempting to plot variables in a table() object. No currently released version of MATLAB supports that directly; you would need to instead
plot(data.signalTime, data.signalNoise, '.')
채택된 답변
추가 답변 (1개)
ejjada
2024년 3월 16일
0 개 추천
plz anyone answer me
how to read my hole x axis data as x1,x2,x3,x4,...
댓글 수: 1
Walter Roberson
2024년 3월 16일
Please read http://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-not-be-named-dynamically-eval for information about why we strongly recommend against creating variable names dynamically.
카테고리
도움말 센터 및 File Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!