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

9 ビュー (過去 30 日間)
Ashley
Ashley 2023 年 8 月 26 日
コメント済み: Walter Roberson 2023 年 8 月 27 日
%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')

採用された回答

Voss
Voss 2023 年 8 月 26 日
編集済み: Voss 2023 年 8 月 26 日

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

plot(time,Tc, 'rd')
  1 件のコメント
Walter Roberson
Walter Roberson 2023 年 8 月 27 日
Unless, that is, you use name-value pairs, such as
plot(time, Tc, 'Color', 'r', 'Marker', 'd')

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by