Why won't my graph show?

3 vues (au cours des 30 derniers jours)
Kara Scully
Kara Scully le 21 Sep 2020
Modifié(e) : KSSV le 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')

Réponse acceptée

KSSV
KSSV le 21 Sep 2020
Modifié(e) : KSSV le 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')

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by