how to plot shorter dataset using 'hold on'

1 visualización (últimos 30 días)
Em
Em el 26 de Feb. de 2022
Comentada: Em el 27 de Feb. de 2022
Hi,
I have a dataset and want to plot a line of best fit to the beginning of the data which is the only part where it fits.
Currently, I have the lines of code:
scatter(T5half,logconductivity5(2:end))
hold on
y=-21.05*T5half-25.18
plot(T5half,y)
Does anyone know how to do this?
Thanks.

Respuesta aceptada

Jeff Miller
Jeff Miller el 26 de Feb. de 2022
Is this what you need?
desired_range = 1:200; % here, select the array positions you want to plot
plot(T5half(desired_range),y(desired_range))

Más respuestas (0)

Categorías

Más información sobre Scatter Plots en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by