matrix dimensions must agree
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
I am trying to calculate the max temperature after individual time periods incremented in 1seconds (t_actuation_sC_r) but it will not work, it only calculates the max temp if i make the time a single number. any ideas why it won't work?
the D is a data file on my computer don't think its necessary to put in
t_actuation_sC_r=linspace(1,150,150);
t_max_sC_r=D.T_atm+((0.5*D.I_r*D.w_max^2)/(2*D.c_avg*((pi*(D.ro_r_s)^2)*D.thick_sC_avg)*D.rho_C_avg*(1-exp(-(t_actuation_sC_r*(D.h_C_avg-((2*pi*D.ro_r_s^2)+(pi*2*D.ro_r_s*D.thick_sC_avg))))/(D.c_avg*(((pi*(D.ro_r_s)^2)*D.thick_sC_avg)*D.rho_C_avg))))))
2 个评论
Michael Haderlein
2015-3-31
编辑:Michael Haderlein
2015-3-31
This comment moved from the redundant question ( http://de.mathworks.com/matlabcentral/answers/195409-someone-please-help-submission-in-2-days-need-to-make-this-work-somehow ):
Based on the information you give, it's impossible to say. Please (1) post all the relevant code (please also format it as code with the button above the field in which you enter the question), (2) tell us what is not working (error message? Wrong value? ...?) and (3) tell us what is D (as D seems to be a struct, best you just enter "D" in the command window and give us the output).
Also, please don't post the same question twice.
Edric Ellis
2015-3-31
FYI: I removed the duplicate question.
回答(1 个)
Torsten
2015-3-31
0 个投票
Multiplication, division and potentiation of arrays in your case is always componentwise - thus you will have to use .*, ./ and .^ instead of *, / and ^.
Best wishes
Torsten.
1 个评论
Michael Haderlein
2015-3-31
Yes, most likely the answer goes in this direction. However, if t_actuation_sC_r is the only array with more than one element, this won't be the error, at least not in the code snipped shown here. t_actuation_sC_r appears only once in the equation and is not powered, thus, * and / should work here. Until we don't know more, all we can do is guessing.
此问题已关闭。
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!