Azzera filtri
Azzera filtri

help!!!plot problem not a line

2 visualizzazioni (ultimi 30 giorni)
Qiandong Dong
Qiandong Dong il 26 Dic 2019
Risposto: Mohammad Sami il 26 Dic 2019
clear all
a=400;
b=2;
k=6;
v=200;
e=2;
cp=2;
pr=1;
w=15;
u=0.1:1;
p=(2.*a.*v + 2.*b.*v.*w - 2.*cp.*e.*k.*v - a.*b.*pr.^2*u.^2 + b.*cp.*e.*k.*pr.^2*u.^2)./(b.*(- b.*pr.^2*u.^2 + 4.*v));
plot(p,'rs-','Linewidth',1.5)
grid on;
Why just a point when plot?

Risposta accettata

Mohammad Sami
Mohammad Sami il 26 Dic 2019
This is because your code as stated will only output a single value for variable 'p';
This is because of how you initialised the variable 'u'.
u=0.1:1;
u % u is assigned a value of 0.1.
I assume you were trying to initialise u as a vector between 0.1 and 1, with increments of 0.1. You can do it as follows
u = 0.1:0.1:1;
u

Più risposte (0)

Categorie

Scopri di più su Graphics Objects in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by