フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

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

1 回表示 (過去 30 日間)
barry conrad
barry conrad 2018 年 12 月 10 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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 件のコメント
barry conrad
barry conrad 2018 年 12 月 10 日
i dont think Tin contains NaNs but i choose to plot as i go instead of an array
Jan
Jan 2018 年 12 月 10 日
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.

回答 (1 件)

madhan ravi
madhan ravi 2018 年 12 月 10 日
use 'b' as marker instead of 'x'
  2 件のコメント
barry conrad
barry conrad 2018 年 12 月 10 日
編集済み: barry conrad 2018 年 12 月 10 日
doesnt work,graph shows up completely blank
madhan ravi
madhan ravi 2018 年 12 月 10 日
Then upload the data file to break it down...

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by