Why won't my graph show?

1 view (last 30 days)
Kara Scully
Kara Scully on 21 Sep 2020
Edited: KSSV on 21 Sep 2020
%all of the variables except R0 are parameters I change
% The format for the list worked in a different plot
%not sure why it is not working now
clear;
clc;
T1=500;
T0=300;
R1=.10;
R0=(.1:.01:1);
h=100;
k=.05;
qoverL=(2*pi*(T1-T0))/((log(R0/R1)/k)+(1/h*R0));
plot(R0,qoverL);
xlabel('R0')
ylabel('q/L')
title('Heat lost vs R0')

Accepted Answer

KSSV
KSSV on 21 Sep 2020
Edited: KSSV on 21 Sep 2020
Read about element by element operations. You need to use ./ in the line which shows error.
%all of the variables except R0 are parameters I change
% The format for the list worked in a different plot
%not sure why it is not working now
clear;
clc;
T1=500;
T0=300;
R1=.10;
R0=(.1:.01:1);
h=100;
k=.05;
qoverL=(2*pi*(T1-T0))./((log(R0/R1)/k)+(1/h*R0)); % <----here use ./ as R0 is array
plot(R0,qoverL);
xlabel('R0')
ylabel('q/L')
title('Heat lost vs R0')

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!