plotting line parallel to the x-axis instead of the y-axis

7 Ansichten (letzte 30 Tage)
david leonard
david leonard am 10 Feb. 2021
Beantwortet: randerss simil am 10 Feb. 2021
Hi Folks,
i have the following code.
int = A{:,4};
wl = A{:,1};
plot(wl-0.01,0,'b',wl,int,'b',wl+0.01,0,'b')
it reads in numbers from an imported excel sheet and plots it.
the numbers are read as double with 3 decimal places. i am adding 0 either side of the values to be adjusted at a later date.
the plotted line starts from the bottom of the y axis=0 and plots going up i.e. it plots going up. i want it to start at the x=0 point and plot the line going away in the x+ direction instead of the y+ direction. Any ideas how to do this?
Thanks,
Dave

Antworten (1)

randerss simil
randerss simil am 10 Feb. 2021
%if
plot([wl-0.01,0],intt,'b',wl,intt,'b',[wl+0.01,0],intt,'b')
Use [] for adding elements and int is standard function in matlab. So i changed it to something like intt

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by