Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Trying to create a plot with a line as shown in the pictures

1 vue (au cours des 30 derniers jours)
barry conrad
barry conrad le 10 Déc 2018
Clôturé : MATLAB Answer Bot le 20 Août 2021
my code: im using a for loop to create a graph and plot as it works out but i can only get the graph to look like the first pic below, what would be the lines of code to get it to look like the second graph? (just one line ofcourse i couldnt find another one on the internet) thanks for the help!
figure(1)
plot(t,Tin,'--xb')
title('Room temperature over time for Tlower=21^oC and Tupper=24^oC')
xlabel('Time(s)')
ylabel('Temperature(degrees)')
hold on
  5 commentaires
barry conrad
barry conrad le 10 Déc 2018
i dont think Tin contains NaNs but i choose to plot as i go instead of an array
Jan
Jan le 10 Déc 2018
Instead of thinking, simply check if it contains NaNs:
any(isnan(Tin))
What does "i choose to plot as i go instead of an array" mean? Of course, if you create the diagram by calling plot in a loop, you cannot get a line. So please post exactly the code you use and provide the input data.

Réponses (1)

madhan ravi
madhan ravi le 10 Déc 2018
use 'b' as marker instead of 'x'
  2 commentaires
barry conrad
barry conrad le 10 Déc 2018
Modifié(e) : barry conrad le 10 Déc 2018
doesnt work,graph shows up completely blank
madhan ravi
madhan ravi le 10 Déc 2018
Then upload the data file to break it down...

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by