1x7 double

7 views (last 30 days)
Noora Muhamad
Noora Muhamad on 22 Sep 2015
Commented: Noora Muhamad on 22 Sep 2015
I'm trying to create a table using certain equations.
%V = voltage across nth resistor
%Resistor = value of nth resistor
%Requal = total sum of resistors
%VS = voltage source = 120 volts
VS=120
Resistor=[200,140,120,180,80,150,100];
Requal=sum(Resistor)
Vn=(Resistor/Requal)*VS;
%Vn = votage across nth resistor
Pn=Vn.^2./[Resistor]
%Pn=power dissipated in nth resistor
T=table(Resistor,Vn,Pn)
I so far have this however every time I run the program it gives me a 1x7 double under the columns. How do I get rid of the 1x7?

Answers (1)

Matt J
Matt J on 22 Sep 2015
Edited: Matt J on 22 Sep 2015
Make Resistor a column vector instead of a row vector,
VS=120
Resistor=[200,140,120,180,80,150,100].'; %<---Column vector
...
T=table(Resistor,Vn,Pn)
  1 Comment
Noora Muhamad
Noora Muhamad on 22 Sep 2015
Thank you so much!!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!