Why do I keep getting "Error using plot Invalid data argument."

14 Ansichten (letzte 30 Tage)
Ashley
Ashley am 26 Aug. 2023
Kommentiert: Walter Roberson am 27 Aug. 2023
%Inputs
prompt1 = 'What is Tc?'
Tc = input(prompt1) % In degrees F
k = 0.342;
Prompt2 = 'What is Tr?'
Tr = input(Prompt2); % In degrees F
Prompt3 = 'What is Ti?'
Ti = input(Prompt3); % In degrees F
t = -1/k.*log((Tc-Tr)/(Ti-Tr)) % Equation for amount of time taken
time = linspace(0,t*2) % Time vector
Tc = Tr + (Ti - Tr)*exp(-k*t) % Equation for fridge temp
plot(time,Tc, 'r', 'd')

Akzeptierte Antwort

Voss
Voss am 26 Aug. 2023
Bearbeitet: Voss am 26 Aug. 2023

Linespec (style, color, marker) should be specified as a single argument:

plot(time,Tc, 'rd')

Weitere Antworten (0)

Kategorien

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

Community Treasure Hunt

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

Start Hunting!

Translated by