Calculate the power using the current values inside matrix
古いコメントを表示
how do you work out a loop to calculate power when you have been give the current ( a 6*6)matrix. and your answer in a matrix form should have 36 members annd you are supposed to have 6 loop sentences to calculate the 36 values?
2 件のコメント
Fangjun Jiang
2011 年 8 月 10 日
Do you need the voltage to calculate the power from current?
Walter Roberson
2011 年 8 月 10 日
Is the current a 6*6 matrix as in your question, or a 6*1 matrix as in your Tags ?
回答 (2 件)
Walter Roberson
2011 年 8 月 10 日
For the case where they are 6 x 1, something like:
bsxfun(@times, current(:), voltage(:).')
Fangjun Jiang
2011 年 8 月 10 日
Voltage=1:6;
Current=0.1:0.1:0.6;
Power=zeros(6,6);
for k=1:6
for j=1:6
Power(k,j)=Voltage(k)*Current(j);
end
end
カテゴリ
ヘルプ センター および File Exchange で Mathematics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!