Using imported data in an equation
조회 수: 1 (최근 30일)
이전 댓글 표시
I have an equation with several known constants and three variables; efficiency, Cp and T1. I am trying to calculate efficiency. I have attached an image of the equation.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/551352/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/551352/image.jpeg)
However, Cp changes depending on T1. I have imported an excel spreasheet that gives the values of Cp at a variety of temperatures.
How do I use MATLAB to calculate efficiency at the specified combinations of T1 and Cp so that I can plot a graph of T1 against efficiency?
댓글 수: 0
채택된 답변
Cris LaPierre
2021년 3월 15일
편집: Cris LaPierre
2021년 3월 15일
I would create a vector of T1 values, and a vector of the corresponding cp values. I would then compute efficiency using the vectors of T1 and cp. If the equation is set up properly using array (elementwise) operations, efficiency should be a vector the same size as T1.
댓글 수: 2
Cris LaPierre
2021년 3월 15일
Sounds like a result of implicit expansion. Somewhere you are multiplying or adding a 1x29 with a 29x1, resulting in a 29x29.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!