1x7 double
古いコメントを表示
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?
回答 (1 件)
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)
カテゴリ
ヘルプ センター および File Exchange で Dynamic System Models についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!