Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
How to change the way matlab choose to plot given vectors?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have 2 vectors, for example I`ll show the basic point scattering on a plot
amp1=[4.59200000000000e-05;5.82746666666667e-05;3.73920000000000e-05;2.93013333333333e-05;1.47600000000000e-05]
dc_voltages=[127.300000000000,138,66.4000000000000,78,96.4000000000000]
plot(dc_voltages,amp1,'x')
so I get:
![scatter1.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/216804/scatter1.png)
I want to connect those dots such that I will get the picture:
![scatter1_2.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/216805/scatter1_2.png)
but when I try:
plot(dc_voltages,amp1,'--x')
I get:
![scatter3.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/216806/scatter3.png)
I don`t use cftool because I have to fit a lot of similar graphs in the same figure.
Please help
댓글 수: 0
답변 (1개)
Star Strider
2019년 4월 26일
Sort ‘dc_voltages’:
[~,idx] = sort(dc_voltages); % Sorts Ascending By Default
figure
plot(dc_voltages(idx),amp1(idx),'--x')
Only the order has changed.
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!